summary refs log tree commit diff
path: root/dist/util/checkToken.js
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 23:55:26 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-04-06 23:55:26 +0200
commit011251868d4ec0c4d6cda4509d38e09d7d331cf2 (patch)
tree2c4aa589d4fee812e116edca71680071e3b6b2ef /dist/util/checkToken.js
parent:art: remove _id and __v from response (diff)
parentMerge pull request #2 from afeuerstein/main (diff)
downloadserver-011251868d4ec0c4d6cda4509d38e09d7d331cf2.tar.xz
Merge branch 'main' of https://github.com/discord-open-source/discord-server-util into main
Diffstat (limited to 'dist/util/checkToken.js')
-rw-r--r--dist/util/checkToken.js20
1 files changed, 0 insertions, 20 deletions
diff --git a/dist/util/checkToken.js b/dist/util/checkToken.js
deleted file mode 100644

index 17d88178..00000000 --- a/dist/util/checkToken.js +++ /dev/null
@@ -1,20 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkToken = void 0; -const Constants_1 = require("./Constants"); -const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); -const Config_1 = __importDefault(require("./Config")); -function checkToken(token) { - return new Promise((res, rej) => { - jsonwebtoken_1.default.verify(token, Config_1.default.getAll().api.security.jwtSecret, Constants_1.JWTOptions, (err, decoded) => { - if (err || !decoded) - return rej("Invalid Token"); - return res(decoded); - }); - }); -} -exports.checkToken = checkToken; -//# sourceMappingURL=checkToken.js.map \ No newline at end of file