Skip to content

Commit 2d7ca7f

Browse files
committed
better error message for invalid emails
1 parent 398b157 commit 2d7ca7f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/src/routers/save_account.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ router.post('/save_account', auth, express.json(), async (req, res, next)=>{
8181
const clean_email = svc_cleanEmail.clean(req.body.email);
8282

8383
if ( ! await svc_cleanEmail.validate(clean_email) ) {
84-
return res.status(400).send('This email domain is not allowed.');
84+
return res.status(400).send('This email does not seem to be valid.');
8585
}
8686

8787
const svc_edgeRateLimit = req.services.get('edge-rate-limit');

src/backend/src/routers/signup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ module.exports = eggspress(['/signup'], {
190190
const clean_email = svc_cleanEmail.clean(req.body.email);
191191

192192
if (clean_email !== '' && !req.body.is_temp && ! await svc_cleanEmail.validate(clean_email) ) {
193-
return res.status(400).send('Failed to create an account. Please try again.');
193+
return res.status(400).send('This email does not seem to be valid.');
194194
}
195195

196196
// duplicate username check

0 commit comments

Comments
 (0)