3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-23 09:35:02 +00:00

running prettier

This commit is contained in:
Luke 2021-10-08 14:10:08 -05:00
parent d5c9e8d73e
commit b74c6ac2a5

View file

@ -90,21 +90,18 @@ export class ApiLogins extends BaseRepository {
const [loginId, token] = apiKey.split(".");
if (!loginId || !token) return;
const updated_time = moment().utc().add(LOGIN_EXPIRY_TIME, "ms");
const updatedTime = moment().utc().add(LOGIN_EXPIRY_TIME, "ms");
const login = await this.apiLogins
.createQueryBuilder()
.where("id = :id", { id: loginId })
.getOne();
if(!login) return;
const login = await this.apiLogins.createQueryBuilder().where("id = :id", { id: loginId }).getOne();
if(moment.utc(login.expires_at).isSameOrAfter(updated_time)) return;
if (!login) return;
if (moment.utc(login.expires_at).isSameOrAfter(updatedTime)) return;
await this.apiLogins.update(
{ id: loginId },
{
expires_at: updated_time.format(DBDateFormat)
expires_at: updatedTime.format(DBDateFormat),
},
);
}