fixup! merge signup and google signup handling with username support
This commit is contained in:
parent
e2dd78fca3
commit
bec8b79680
@ -336,10 +336,6 @@ class LoginController
|
||||
return new JsonContent(['error' => ['errorText' => 'The given email address is not valid.']]);
|
||||
}
|
||||
|
||||
if (strlen(\Container::$request->post('username')) > 0 && preg_match('/^[a-zA-Z0-9_\-\.]+$/', \Container::$request->post('username')) !== 1) {
|
||||
return new JsonContent(['error' => ['errorText' => 'Username can contain only english letters, digits, - (hyphen), . (dot), _ (underscore).']]);
|
||||
}
|
||||
|
||||
if (\Container::$request->session()->has('tmp_user_data')) {
|
||||
$tmpUserData = \Container::$request->session()->get('tmp_user_data');
|
||||
|
||||
@ -368,6 +364,10 @@ class LoginController
|
||||
$newUser->setPlainPassword(\Container::$request->post('password'));
|
||||
}
|
||||
|
||||
if (strlen(\Container::$request->post('username')) > 0 && preg_match('/^[a-zA-Z0-9_\-\.]+$/', \Container::$request->post('username')) !== 1) {
|
||||
return new JsonContent(['error' => ['errorText' => 'Username can contain only english letters, digits, - (hyphen), . (dot), _ (underscore).']]);
|
||||
}
|
||||
|
||||
$newUser->setUsername(strlen(\Container::$request->post('username')) > 0 ? \Container::$request->post('username') : Factory::create()->userName);
|
||||
$newUser->setCreatedDate(new DateTime());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user