fixup! merge signup and google signup handling with username support

This commit is contained in:
Bence Pőcze 2023-09-24 01:08:27 +02:00
parent 2cd55daf3b
commit aca8bdb4b1
Signed by: bence
GPG Key ID: DC5BD6E95A333E6D

View File

@ -334,6 +334,10 @@ 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');