summary refs log tree commit diff
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-04-24 22:40:36 +0300
committerGitHub <noreply@github.com>2022-04-24 22:40:36 +0300
commit6f031c2839c85f8d43aff211b18949403fcca383 (patch)
treee7c868ad9dcb98a52cacd8bd53278e0fa4707cd8
parentUpdate RateLimit.ts (diff)
downloadserver-6f031c2839c85f8d43aff211b18949403fcca383.tar.xz
Update Token.ts
-rw-r--r--util/src/util/Token.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/src/util/Token.ts b/util/src/util/Token.ts

index 7c4cc61d..500ace45 100644 --- a/util/src/util/Token.ts +++ b/util/src/util/Token.ts
@@ -6,7 +6,12 @@ export const JWTOptions: VerifyOptions = { algorithms: ["HS256"] }; export function checkToken(token: string, jwtSecret: string): Promise<any> { return new Promise((res, rej) => { - token = token.replace("Bot ", ""); // TODO: proper bot support + token = token.replace("Bot ", ""); + /** + in fosscord, even with instances that have bot distinction; we won't enforce "Bot" prefix, + as we don't really have separate pathways for bots + **/ + jwt.verify(token, jwtSecret, JWTOptions, async (err, decoded: any) => { if (err || !decoded) return rej("Invalid Token");