invalidate authentication for locked accounts
parent
9a77963823
commit
9c6e900802
|
@ -40,6 +40,7 @@ export default class Security {
|
||||||
const res: any = jwt.verify(bearer, this.keys.key, { issuer: 'Library of Code sp-us | CSD' });
|
const res: any = jwt.verify(bearer, this.keys.key, { issuer: 'Library of Code sp-us | CSD' });
|
||||||
const account = await this.client.db.Account.findOne({ _id: res.id });
|
const account = await this.client.db.Account.findOne({ _id: res.id });
|
||||||
if (!account) return null;
|
if (!account) return null;
|
||||||
|
if (account.locked) return null;
|
||||||
if (account.revokedBearers?.includes(bearer)) return null;
|
if (account.revokedBearers?.includes(bearer)) return null;
|
||||||
return account;
|
return account;
|
||||||
} catch {
|
} catch {
|
||||||
|
|
Loading…
Reference in New Issue