fix(server): should allowed email addresses and domain be irrespective.

This commit is contained in:
a.bouhuolia
2023-05-08 00:35:28 +02:00
parent 18b9e25f2b
commit ce38c71fa7
3 changed files with 18 additions and 38 deletions

View File

@@ -277,30 +277,18 @@ export default class AuthenticationController extends BaseController {
],
});
}
if (error.errorType === 'SIGNUP_NOT_ALLOWED_EMAIL_DOMAIN') {
if (error.errorType === 'SIGNUP_RESTRICTED_NOT_ALLOWED') {
return res.status(400).send({
errors: [
{
type: 'SIGNUP_NOT_ALLOWED_EMAIL_DOMAIN',
type: 'SIGNUP_RESTRICTED_NOT_ALLOWED',
message:
'Sign-up is restricted the given email domain is not allowed to sign-up.',
'Sign-up is restricted the given email address is not allowed to sign-up.',
code: 710,
},
],
});
}
if (error.errorType === 'SIGNUP_NOT_ALLOWED_EMAIL_ADDRESS') {
return res.status(400).send({
errors: [
{
type: 'SIGNUP_NOT_ALLOWED_EMAIL_ADDRESS',
message:
'The sign-up restricted the given email address is not allowed to sign-up.',
code: 720,
},
],
});
}
}
next(error);
}