mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-18 17:45:28 +00:00
✨ allow bot tokens
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user