1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-13 06:02:39 +01:00

⬆️ 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 9 additions and 9 deletions

14
package-lock.json generated
View File

@ -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",

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);