Loading lib/Controller/AccountController.php +3 −1 Original line number Diff line number Diff line Loading @@ -253,13 +253,13 @@ class AccountController extends Controller { $response->setStatus(400); if (empty($username)) { $response->setData(['message' => 'Username is required.', 'success' => false]); return $response; } $validationError = $this->validateInput('username', $username, 30); if ($validationError !== null) { $response->setData(['message' => $validationError, 'success' => false]); $response->setStatus(403); return $response; } Loading @@ -268,6 +268,8 @@ class AccountController extends Controller { if (!$this->userService->userExists($username) && !$this->userService->isUsernameTaken($username)) { $response->setStatus(200); $this->session->set(self::SESSION_USERNAME_CHECK, true); } else { $response->setData(['message' => 'Username is already taken.', 'success' => false]); } } catch (Exception $e) { $this->logger->logException($e, ['app' => Application::APP_ID ]); Loading src/signup/RegistrationForm.vue +1 −3 Original line number Diff line number Diff line Loading @@ -299,10 +299,8 @@ export default { this.isUsernameAvailable = true } catch (error) { this.validation.isUsernameNotValid = true if (error.response && error.response.status === 403) { if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, error.response.data.message) } else if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, 'Username is already taken.') } else { this.usernameValidationMessage = t(this.appName, 'Something went wrong.') } Loading Loading
lib/Controller/AccountController.php +3 −1 Original line number Diff line number Diff line Loading @@ -253,13 +253,13 @@ class AccountController extends Controller { $response->setStatus(400); if (empty($username)) { $response->setData(['message' => 'Username is required.', 'success' => false]); return $response; } $validationError = $this->validateInput('username', $username, 30); if ($validationError !== null) { $response->setData(['message' => $validationError, 'success' => false]); $response->setStatus(403); return $response; } Loading @@ -268,6 +268,8 @@ class AccountController extends Controller { if (!$this->userService->userExists($username) && !$this->userService->isUsernameTaken($username)) { $response->setStatus(200); $this->session->set(self::SESSION_USERNAME_CHECK, true); } else { $response->setData(['message' => 'Username is already taken.', 'success' => false]); } } catch (Exception $e) { $this->logger->logException($e, ['app' => Application::APP_ID ]); Loading
src/signup/RegistrationForm.vue +1 −3 Original line number Diff line number Diff line Loading @@ -299,10 +299,8 @@ export default { this.isUsernameAvailable = true } catch (error) { this.validation.isUsernameNotValid = true if (error.response && error.response.status === 403) { if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, error.response.data.message) } else if (error.response && error.response.status === 400) { this.usernameValidationMessage = t(this.appName, 'Username is already taken.') } else { this.usernameValidationMessage = t(this.appName, 'Something went wrong.') } Loading