mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-03 12:10:42 -06:00
Check for block code. [skip ci]
This commit is contained in:
parent
150b6fe5b6
commit
89d565e63b
@ -60,12 +60,21 @@ class AuthController extends Controller
|
||||
}
|
||||
|
||||
$credentials = $this->getCredentials($request);
|
||||
$credentials['blocked'] = 0;
|
||||
$credentials['blocked'] = 0; // most not be blocked.
|
||||
|
||||
if (Auth::attempt($credentials, $request->has('remember'))) {
|
||||
return $this->handleUserWasAuthenticated($request, $throttles);
|
||||
}
|
||||
|
||||
// default error message:
|
||||
$message = $this->getFailedLoginMessage();
|
||||
|
||||
// try to find a user with this address and blocked_code "bounced".
|
||||
$count = User::where('email', $credentials['email'])->where('blocked', 1)->where('blocked_code', 'bounced')->count();
|
||||
if ($count == 1) {
|
||||
$message = trans('firefly.bounce_error', ['email' => $credentials['email']]);
|
||||
}
|
||||
|
||||
// If the login attempt was unsuccessful we will increment the number of attempts
|
||||
// to login and redirect the user back to the login form. Of course, when this
|
||||
// user surpasses their maximum number of attempts they will get locked out.
|
||||
@ -77,7 +86,7 @@ class AuthController extends Controller
|
||||
->withInput($request->only($this->loginUsername(), 'remember'))
|
||||
->withErrors(
|
||||
[
|
||||
$this->loginUsername() => $this->getFailedLoginMessage(),
|
||||
$this->loginUsername() => $message,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user