mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-11 05:02:37 +01:00
added deleted and disabled check for checkToken
This commit is contained in:
parent
8bd0326f80
commit
c9bc622f6d
@ -10,7 +10,7 @@ export function checkToken(token: string, jwtSecret: string): Promise<any> {
|
||||
|
||||
const user = await UserModel.findOne(
|
||||
{ id: decoded.id },
|
||||
{ "user_data.valid_tokens_since": true, bot: true }
|
||||
{ "user_data.valid_tokens_since": true, bot: true, disabled: true, deleted: true }
|
||||
).exec();
|
||||
if (!user) return rej("Invalid Token");
|
||||
// we need to round it to seconds as it saved as seconds in jwt iat and valid_tokens_since is stored in milliseconds
|
||||
|
Loading…
Reference in New Issue
Block a user