mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-13 07:53:16 +00:00
Check for block code. [skip ci]
This commit is contained in:
@@ -60,12 +60,21 @@ class AuthController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$credentials = $this->getCredentials($request);
|
$credentials = $this->getCredentials($request);
|
||||||
$credentials['blocked'] = 0;
|
$credentials['blocked'] = 0; // most not be blocked.
|
||||||
|
|
||||||
if (Auth::attempt($credentials, $request->has('remember'))) {
|
if (Auth::attempt($credentials, $request->has('remember'))) {
|
||||||
return $this->handleUserWasAuthenticated($request, $throttles);
|
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
|
// 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
|
// 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.
|
// 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'))
|
->withInput($request->only($this->loginUsername(), 'remember'))
|
||||||
->withErrors(
|
->withErrors(
|
||||||
[
|
[
|
||||||
$this->loginUsername() => $this->getFailedLoginMessage(),
|
$this->loginUsername() => $message,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user