mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 21:44:47 +00:00
don't return token on register if verification required
This commit is contained in:
1 parent
05453ec148
commit
ed38d74b3e
1 file changed
+11
@@ -278,6 +278,17 @@ 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) });
|
||||
},
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user