From 5000f8e518c66bfb055fdef1d8e75e0f98ca3ded Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sun, 23 May 2021 01:23:03 +0200 Subject: :bug: fix checktoken --- src/util/checkToken.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/util/checkToken.ts') diff --git a/src/util/checkToken.ts b/src/util/checkToken.ts index d5a128b4..80896de7 100644 --- a/src/util/checkToken.ts +++ b/src/util/checkToken.ts @@ -1,10 +1,9 @@ import { JWTOptions } from "./Constants"; import jwt from "jsonwebtoken"; -import Config from "./Config"; -export function checkToken(token: string): Promise { +export function checkToken(token: string, jwtSecret: string): Promise { return new Promise((res, rej) => { - jwt.verify(token, Config.getAll()?.api?.security?.jwtSecret, JWTOptions, (err, decoded: any) => { + jwt.verify(token, jwtSecret, JWTOptions, (err, decoded: any) => { if (err || !decoded) return rej("Invalid Token"); return res(decoded); -- cgit 1.5.1