summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-23 01:23:03 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-23 01:23:03 +0200
commit5000f8e518c66bfb055fdef1d8e75e0f98ca3ded (patch)
treed2076a9aef47a770097efae5b6bbedc570a89136 /src
parentMerge pull request #5 from DiegoMagdaleno/master (diff)
downloadserver-5000f8e518c66bfb055fdef1d8e75e0f98ca3ded.tar.xz
:bug: fix checktoken
Diffstat (limited to 'src')
-rw-r--r--src/index.ts4
-rw-r--r--src/util/checkToken.ts5
2 files changed, 4 insertions, 5 deletions
diff --git a/src/index.ts b/src/index.ts
index 343a7496..3565fb6b 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -4,7 +4,7 @@ export * as Constants from "./util/Constants";
 export * from "./models/index";
 export * from "./util/index";
 
-import Config, { DefaultOptions } from "./util/Config";
+import Config from "./util/Config";
 import db, { MongooseCache, toObject } from "./util/Database";
 
-export { Config, db, DefaultOptions, MongooseCache, toObject };
+export { Config, db, MongooseCache, toObject };
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<any> {
+export function checkToken(token: string, jwtSecret: string): Promise<any> {
 	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);