⬆️ update checkToken usage
This commit is contained in:
		
							parent
							
								
									8437156fd3
								
							
						
					
					
						commit
						b0e7a80f34
					
				
							
								
								
									
										14
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										14
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -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", | ||||
|  | ||||
| @ -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", | ||||
|  | ||||
| @ -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); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user