From aca8bdb4b17371bd13420b9c89fb56c44d987005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 24 Sep 2023 01:08:27 +0200 Subject: [PATCH] fixup! merge signup and google signup handling with username support --- src/Controller/LoginController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Controller/LoginController.php b/src/Controller/LoginController.php index 369a896..2a8e3e3 100644 --- a/src/Controller/LoginController.php +++ b/src/Controller/LoginController.php @@ -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');