mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Improve code quality.
This commit is contained in:
@@ -89,9 +89,11 @@ class Authenticate
|
||||
if (empty($guards)) {
|
||||
try {
|
||||
// go for default guard:
|
||||
/** @noinspection PhpUndefinedMethodInspection */
|
||||
if ($this->auth->check()) {
|
||||
|
||||
// do an extra check on user object.
|
||||
/** @noinspection PhpUndefinedMethodInspection */
|
||||
$user = $this->auth->authenticate();
|
||||
if (1 === (int)$user->blocked) {
|
||||
$message = (string)trans('firefly.block_account_logout');
|
||||
@@ -99,6 +101,7 @@ class Authenticate
|
||||
$message = (string)trans('firefly.email_changed_logout');
|
||||
}
|
||||
app('session')->flash('logoutMessage', $message);
|
||||
/** @noinspection PhpUndefinedMethodInspection */
|
||||
$this->auth->logout();
|
||||
|
||||
throw new AuthenticationException('Blocked account.', $guards);
|
||||
@@ -114,13 +117,14 @@ class Authenticate
|
||||
);
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
/** @noinspection PhpUndefinedMethodInspection */
|
||||
return $this->auth->authenticate();
|
||||
}
|
||||
|
||||
// @codeCoverageIgnoreStart
|
||||
foreach ($guards as $guard) {
|
||||
if ($this->auth->guard($guard)->check()) {
|
||||
/** @noinspection PhpVoidFunctionResultUsedInspection */
|
||||
return $this->auth->shouldUse($guard);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user