From b0e7a80f347badb28b2a21b5ec877fb0e86ec0b8 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Wed, 30 Jun 2021 21:58:10 +0200 Subject: [PATCH] :arrow_up: update checkToken usage --- package-lock.json | 14 +++++++------- package.json | 2 +- src/opcodes/Identify.ts | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index b429fe00..7e29848b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "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", @@ -31,9 +31,9 @@ } }, "node_modules/@fosscord/server-util": { - "version": "1.3.16", - "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.3.16.tgz", - "integrity": "sha512-/oDDGyWllVNMb/84wzzYQ6vpwkcW+mg57ECWS5bUDQ0OhT3apdpYgQFfWxwGYgyYo6fB4gmyJh/U2bzWo6Jmeg==", + "version": "1.3.22", + "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.3.22.tgz", + "integrity": "sha512-YxkuMwsJmMpCN4zGCq0LHvUuV9zlR8yTriquPqWfp5Sbj1DdFz7Qqo6wz6cRYb3WRIINouHhV60cbljmUqLIJQ==", "dependencies": { "@types/jsonwebtoken": "^8.5.0", "@types/mongoose-autopopulate": "^0.10.1", @@ -2199,9 +2199,9 @@ }, "dependencies": { "@fosscord/server-util": { - "version": "1.3.16", - "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.3.16.tgz", - "integrity": "sha512-/oDDGyWllVNMb/84wzzYQ6vpwkcW+mg57ECWS5bUDQ0OhT3apdpYgQFfWxwGYgyYo6fB4gmyJh/U2bzWo6Jmeg==", + "version": "1.3.22", + "resolved": "https://registry.npmjs.org/@fosscord/server-util/-/server-util-1.3.22.tgz", + "integrity": "sha512-YxkuMwsJmMpCN4zGCq0LHvUuV9zlR8yTriquPqWfp5Sbj1DdFz7Qqo6wz6cRYb3WRIINouHhV60cbljmUqLIJQ==", "requires": { "@types/jsonwebtoken": "^8.5.0", "@types/mongoose-autopopulate": "^0.10.1", diff --git a/package.json b/package.json index 754bf280..e34803b0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/opcodes/Identify.ts b/src/opcodes/Identify.ts index 3b007766..ab2fc301 100644 --- a/src/opcodes/Identify.ts +++ b/src/opcodes/Identify.ts @@ -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);