mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 09:35:02 +00:00
running prettier
This commit is contained in:
parent
d5c9e8d73e
commit
b74c6ac2a5
1 changed files with 6 additions and 9 deletions
|
@ -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),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue