diff --git a/package-lock.json b/package-lock.json index 711d6bb0..1fc96f3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@fosscord/server-util", - "version": "1.2.7", + "version": "1.2.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@fosscord/server-util", - "version": "1.2.7", + "version": "1.2.8", "license": "ISC", "dependencies": { "@types/jsonwebtoken": "^8.5.0", diff --git a/package.json b/package.json index 3379f437..24bc374d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fosscord/server-util", - "version": "1.2.7", + "version": "1.2.8", "description": "Utility functions for the all server repositories", "main": "dist/index.js", "types": "dist/index.d.ts", 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 { +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);