⬆️ update checkToken usage

This commit is contained in:
Flam3rboy 2021-06-30 21:58:10 +02:00
parent 8437156fd3
commit b0e7a80f34
3 changed files with 2 additions and 2 deletions

BIN
package-lock.json generated

Binary file not shown.

View File

@ -13,7 +13,7 @@
"author": "Fosscord",
"license": "ISC",
"dependencies": {
"@fosscord/server-util": "^1.3.16",
"@fosscord/server-util": "^1.3.22",
"ajv": "^8.5.0",
"dotenv": "^8.2.0",
"jsonwebtoken": "^8.5.1",

View File

@ -32,7 +32,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
try {
const { jwtSecret } = Config.get().security;
var decoded = await checkToken(identify.token, jwtSecret); // will throw an error if invalid
var { decoded } = await checkToken(identify.token, jwtSecret); // will throw an error if invalid
} catch (error) {
console.error("invalid token", error);
return this.close(CLOSECODES.Authentication_failed);