PasswordAuthProof: invalidate when user is deleted from DB

This commit is contained in:
Alice Gaudon 2020-07-29 16:19:41 +02:00
parent 886cc576d7
commit a6872cda80
1 changed files with 5 additions and 1 deletions

View File

@ -75,7 +75,11 @@ export class PasswordAuthProof implements AuthProof<User> {
}
public async isValid(): Promise<boolean> {
return await this.isAuthorized() || typeof this.userID === 'number';
if (typeof this.userID === 'number') {
return Boolean(await this.getResource());
} else {
return await this.isAuthorized();
}
}
public async revoke(): Promise<void> {