mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-05 04:15:43 +00:00
added deleted and disabled check for checkToken
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user