diff options
Diffstat (limited to 'app/Api/Auth.php')
-rw-r--r-- | app/Api/Auth.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/Api/Auth.php b/app/Api/Auth.php index b741694b..b3627e4b 100644 --- a/app/Api/Auth.php +++ b/app/Api/Auth.php @@ -29,11 +29,9 @@ class Auth extends Base if ($username !== 'jsonrpc' && ! $this->authentication->hasCaptcha($username) && $this->authentication->authenticate($username, $password)) { $this->checkProcedurePermission(true, $method); $this->userSession->refresh($this->user->getByUsername($username)); - } - else if ($username === 'jsonrpc' && $password === $this->config->get('api_token')) { + } elseif ($username === 'jsonrpc' && $password === $this->config->get('api_token')) { $this->checkProcedurePermission(false, $method); - } - else { + } else { throw new AuthenticationFailure('Wrong credentials'); } } |