MAPG-151 check email address validity on server side
This commit is contained in:
parent
efccb2dcc5
commit
50c7e3972c
@ -14,6 +14,9 @@
|
||||
if (this.response.error) {
|
||||
var errorText;
|
||||
switch (this.response.error) {
|
||||
case 'email_not_valid':
|
||||
errorText = 'The given email address is not valid.'
|
||||
break;
|
||||
case 'passwords_too_short':
|
||||
errorText = 'The given password is too short. Please choose a password that is at least 6 characters long!'
|
||||
break;
|
||||
|
@ -43,6 +43,11 @@ class SignupController
|
||||
return new JsonContent($data);
|
||||
}
|
||||
|
||||
if (filter_var($this->request->post('email'), FILTER_VALIDATE_EMAIL) === false) {
|
||||
$data = ['error' => 'email_not_valid'];
|
||||
return new JsonContent($data);
|
||||
}
|
||||
|
||||
$select = new Select(\Container::$dbConnection, 'users');
|
||||
$select->columns(User::getFields());
|
||||
$select->where('email', '=', $this->request->post('email'));
|
||||
|
Loading…
Reference in New Issue
Block a user