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:
parent
ae1fc50c84
commit
fe2d62cd47
@ -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");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user