Use the correct env variables in config/auth.php file. (#9048)

This commit is contained in:
Ivan Nieto 2021-01-26 14:04:41 -06:00 committed by GitHub
parent 0dc78fdea6
commit 79549dbfb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -189,8 +189,8 @@ class LoginController extends Controller
return redirect()->back()->withInput()->withErrors($validator); return redirect()->back()->withInput()->withErrors($validator);
} }
$this->maxLoginAttempts = config('auth.throttle.max_attempts'); $this->maxLoginAttempts = config('auth.passwords.users.throttle.max_attempts');
$this->lockoutTime = config('auth.throttle.lockout_duration'); $this->lockoutTime = config('auth.passwords.users.throttle.lockout_duration');
if ($lockedOut = $this->hasTooManyLoginAttempts($request)) { if ($lockedOut = $this->hasTooManyLoginAttempts($request)) {
$this->fireLockoutEvent($request); $this->fireLockoutEvent($request);
@ -452,8 +452,8 @@ class LoginController extends Controller
*/ */
protected function hasTooManyLoginAttempts(Request $request) protected function hasTooManyLoginAttempts(Request $request)
{ {
$lockoutTime = config('auth.throttle.lockout_duration'); $lockoutTime = config('auth.passwords.users.throttle.lockout_duration');
$maxLoginAttempts = config('auth.throttle.max_attempts'); $maxLoginAttempts = config('auth.passwords.users.throttle.max_attempts');
return $this->limiter()->tooManyAttempts( return $this->limiter()->tooManyAttempts(
$this->throttleKey($request), $this->throttleKey($request),

View file

@ -103,7 +103,10 @@ return [
'email' => 'auth.emails.password', 'email' => 'auth.emails.password',
'table' => 'password_resets', 'table' => 'password_resets',
'expire' => env('RESET_PASSWORD_LINK_EXPIRES', 900), 'expire' => env('RESET_PASSWORD_LINK_EXPIRES', 900),
'throttle' => env('LOGIN_MAX_ATTEMPTS', 60), 'throttle' => [
'max_attempts' => env('LOGIN_MAX_ATTEMPTS', 5),
'lockout_duration' => env('LOGIN_LOCKOUT_DURATION', 60)
],
], ],
], ],