From 8d13bd0c8d1d41eb29902b400c47c0341378687d Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Sun, 6 Mar 2022 16:39:27 +0100 Subject: [PATCH] chore(back/AuthToken): update to new AuthProof use method from swaf --- src/models/AuthToken.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/models/AuthToken.ts b/src/models/AuthToken.ts index f0d78ca..6826198 100644 --- a/src/models/AuthToken.ts +++ b/src/models/AuthToken.ts @@ -35,11 +35,9 @@ export default class AuthToken extends Model implements AuthProof { } } - /** - * TODO promote this method to AuthProof interface in swaf and call it on successful authentication - */ - public use(): void { + public async use(): Promise { this.used_at = new Date(); + await this.save(); } public canDelete(user_id: number): boolean {