⬆️ update checkToken usage
This commit is contained in:
parent
8437156fd3
commit
b0e7a80f34
BIN
package-lock.json
generated
BIN
package-lock.json
generated
Binary file not shown.
@ -13,7 +13,7 @@
|
|||||||
"author": "Fosscord",
|
"author": "Fosscord",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fosscord/server-util": "^1.3.16",
|
"@fosscord/server-util": "^1.3.22",
|
||||||
"ajv": "^8.5.0",
|
"ajv": "^8.5.0",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
|
|||||||
@ -32,7 +32,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const { jwtSecret } = Config.get().security;
|
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) {
|
} catch (error) {
|
||||||
console.error("invalid token", error);
|
console.error("invalid token", error);
|
||||||
return this.close(CLOSECODES.Authentication_failed);
|
return this.close(CLOSECODES.Authentication_failed);
|
||||||
|
|||||||
Reference in New Issue
Block a user