2 files changed, 6 insertions, 11 deletions
diff --git a/src/api/routes/auth/register.ts b/src/api/routes/auth/register.ts
index c941fdf6..0bf8efae 100644
--- a/src/api/routes/auth/register.ts
+++ b/src/api/routes/auth/register.ts
@@ -278,17 +278,6 @@ router.post(
await Invite.joinGuild(user.id, body.invite);
}
- // return an error for unverified accounts if verification is required
- if (Config.get().login.requireVerification && !user.verified) {
- throw FieldErrors({
- login: {
- code: "ACCOUNT_LOGIN_VERIFICATION_EMAIL",
- message:
- "Email verification is required, please check your email.",
- },
- });
- }
-
return res.json({ token: await generateToken(user.id) });
},
);
diff --git a/src/gateway/opcodes/Identify.ts b/src/gateway/opcodes/Identify.ts
index 030ca66e..1a632b84 100644
--- a/src/gateway/opcodes/Identify.ts
+++ b/src/gateway/opcodes/Identify.ts
@@ -320,6 +320,12 @@ export async function onIdentify(this: WebSocket, data: Payload) {
merged_members: merged_members,
// shard // TODO: only for user sharding
sessions: [], // TODO:
+
+ // lol hack whatever
+ required_action:
+ Config.get().login.requireVerification && !user.verified
+ ? "REQUIRE_VERIFIED_EMAIL"
+ : undefined,
};
// TODO: send real proper data structure
|