From c9bc622f6d9bfa45976db28901ee0af2a7553997 Mon Sep 17 00:00:00 2001 From: xnacly Date: Tue, 10 Aug 2021 20:37:29 +0200 Subject: [PATCH] added deleted and disabled check for checkToken --- src/util/checkToken.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/checkToken.ts b/src/util/checkToken.ts index e021a406..91bf08d5 100644 --- a/src/util/checkToken.ts +++ b/src/util/checkToken.ts @@ -10,7 +10,7 @@ export function checkToken(token: string, jwtSecret: string): Promise { 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