Merge pull request #4433 from NerdyLuffy/BugFix/API-register-user-mail-validation

Add Email validation on user register
This commit is contained in:
Alexandre BODIN 2019-11-04 11:16:48 +01:00 committed by GitHub
commit 10e39516b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -448,6 +448,14 @@ module.exports = {
if (isEmail) {
params.email = params.email.toLowerCase();
} else {
return ctx.badRequest(
null,
formatError({
id: 'Auth.form.error.email.format',
message: 'Please provide valid email address.',
})
);
}
params.role = role.id;