Wrong username fix

This commit is contained in:
Matteo Gheza 2020-11-22 01:31:43 +01:00
parent e2b3f3fad3
commit cddc6a0a49
1 changed files with 5 additions and 0 deletions

View File

@ -563,6 +563,7 @@ class user
}
$this->auth->loginWithUsername($name, $password, $rememberDuration);
}
//TODO: translate errors code
catch (\Delight\Auth\InvalidEmailException $e) {
$this->tools->profiler_stop();
return ["status" => "error", "code" => 010, "text" => "Wrong email address"];
@ -575,6 +576,10 @@ class user
$this->tools->profiler_stop();
return ["status" => "error", "code" => 012, "text" => "Email not verified"];
}
catch (\Delight\Auth\UnknownUsernameException $e) {
$this->tools->profiler_stop();
return ["status" => "error", "code" => 013, "text" => "Wrong username"];
}
catch (\Delight\Auth\TooManyRequestsException $e) {
$this->tools->profiler_stop();
return ["status" => "error", "code" => 020, "text" => "Too many requests"];