summary refs log tree commit diff
path: root/src/gateway/opcodes
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-01-14 18:39:04 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-01-14 18:39:04 +0100
commit45432dd9c87ff398de1faf5a0083c366a2ea391b (patch)
tree3de3f02af22ffbf326ae7ed3655fd94a9a6ea52d /src/gateway/opcodes
parentvar -> let (diff)
downloadserver-45432dd9c87ff398de1faf5a0083c366a2ea391b.tar.xz
Clean up imports dev/rory/versioned-api
Signed-off-by: TheArcaneBrony <myrainbowdash949@gmail.com>
Diffstat (limited to 'src/gateway/opcodes')
-rw-r--r--src/gateway/opcodes/Identify.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts
index 2b1bfc3f..c39a0d01 100644
--- a/src/gateway/opcodes/Identify.ts
+++ b/src/gateway/opcodes/Identify.ts
@@ -24,16 +24,14 @@ import {
 	UserGuildSettings,
 	ReadyGuildDTO,
 	Guild,
+	Recipient,
 } from "@fosscord/util";
 import { Send } from "../util/Send";
 import { CLOSECODES, OPCODES } from "../util/Constants";
-import { genSessionId } from "../util/SessionUtils";
 import { setupListener } from "../listener/listener";
 // import experiments from "./experiments.json";
 const experiments: any = [];
 import { check } from "./instanceOf";
-import { Recipient } from "@fosscord/util";
-
 // TODO: user sharding
 // TODO: check privileged intents, if defined in the config
 // TODO: check if already identified
@@ -50,11 +48,11 @@ export async function onIdentify(this: WebSocket, data: Payload) {
 	try {
 		const { jwtSecret } = Config.get().security;
 		let { decoded } = await checkToken(identify.token, jwtSecret); // will throw an error if invalid
+		this.user_id = decoded.id;
 	} catch (error) {
 		console.error("invalid token", error);
 		return this.close(CLOSECODES.Authentication_failed);
 	}
-	this.user_id = decoded.id;
 	let session_id = this.session_id;
 
 	const [user, read_states, members, recipients, session, application] =