MAPG-151 check email address validity on server side

This commit is contained in:
bence committed 2020-06-18 16:12:40 +02:00
1 parent efccb2dcc5
commit 50c7e3972c
2 files changed
+8

No files matched your search

+5
View File
@@ -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'));