summary refs log tree commit diff
path: root/api/src
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-09 14:00:28 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-09 14:00:28 +0200
commitde681188e5513359f3036138b517e42a3b78fb92 (patch)
treedcabe6e4296a8cf3bd2f98991c4919b4cec99379 /api/src
parent:art: do not auto guest register on login/register page (diff)
downloadserver-de681188e5513359f3036138b517e42a3b78fb92.tar.xz
:bug: fix typing
Diffstat (limited to 'api/src')
-rw-r--r--api/src/routes/auth/register.ts3
-rw-r--r--api/src/routes/channels/#channel_id/typing.ts2
2 files changed, 3 insertions, 2 deletions
diff --git a/api/src/routes/auth/register.ts b/api/src/routes/auth/register.ts
index 4b08e78e..cd1bcb72 100644
--- a/api/src/routes/auth/register.ts
+++ b/api/src/routes/auth/register.ts
@@ -98,7 +98,6 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re
 		}
 	}
 
-	console.log("register", body.email, body.username, ip);
 	// TODO: gift_code_sku_id?
 	// TODO: check password strength
 
@@ -168,6 +167,8 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re
 		await Invite.joinGuild(user.id, body.invite);
 	}
 
+	console.log("register", body.email, body.username, ip);
+
 	return res.json({ token: await generateToken(user.id) });
 });
 
diff --git a/api/src/routes/channels/#channel_id/typing.ts b/api/src/routes/channels/#channel_id/typing.ts
index a9dcb315..45ed76db 100644
--- a/api/src/routes/channels/#channel_id/typing.ts
+++ b/api/src/routes/channels/#channel_id/typing.ts
@@ -9,7 +9,7 @@ router.post("/", route({ permission: "SEND_MESSAGES" }), async (req: Request, re
 	const user_id = req.user_id;
 	const timestamp = Date.now();
 	const channel = await Channel.findOneOrFail({ id: channel_id });
-	const member = await Member.findOneOrFail({ where: { id: user_id }, relations: ["roles"] });
+	const member = await Member.findOneOrFail({ where: { id: user_id }, relations: ["roles", "user"] });
 
 	await emitEvent({
 		event: "TYPING_START",