1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

allow bot tokens

This commit is contained in:
Flam3rboy 2021-06-24 08:52:24 +02:00
parent ae1fc50c84
commit fe2d62cd47

View File

@ -4,6 +4,7 @@ import { UserModel } from "../models";
export function checkToken(token: string, jwtSecret: string): Promise<any> {
return new Promise((res, rej) => {
token = token.replace("Bot ", ""); // TODO: proper bot support
jwt.verify(token, jwtSecret, JWTOptions, async (err, decoded: any) => {
if (err || !decoded) return rej("Invalid Token");