A free open source IT asset/license management system
Updated throttling override for 5.3
snipe68ac4abe2caf
diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.phpindex 9fbe7d9cb6..8079477f28 100644--- a/app/Http/Controllers/Auth/LoginController.php+++ b/app/Http/Controllers/Auth/LoginController.php@@ -285,17 +285,34 @@ class LoginController extends Controller*/protected function sendLockoutResponse(Request $request){- $seconds = $this->limiter()->availableIn(- $this->throttleKey($request)- );+ $seconds = $this->limiter()->availableIn(+ $this->throttleKey($request)+ );++ $minutes = round($seconds / 60);- $message = \Lang::has('auth/message.throttle')- ? \Lang::get('auth/message.throttle', ['seconds' => $seconds])- : 'Too many login attempts. Please try again in '.$seconds.' seconds.';+ $message = \Lang::get('auth/message.throttle',['minutes' => $minutes]);++ return redirect()->back()+ ->withInput($request->only($this->username(), 'remember'))+ ->withErrors([$this->username() => $message]);+ }- return redirect()->back()- ->withInput($request->only($this->username(), 'remember'))- ->withErrors([$this->username() => $message]);++ /**+ * Override the lockout time and duration+ *+ * @param \Illuminate\Http\Request $request+ * @return \Illuminate\Http\RedirectResponse+ */+ protected function hasTooManyLoginAttempts(Request $request)+ {+ $lockoutTime = config('auth.throttle.lockout_duration');+ $maxLoginAttempts = config('auth.throttle.max_attempts');++ return $this->limiter()->tooManyAttempts(+ $this->throttleKey($request), $maxLoginAttempts, $lockoutTime+ );}}diff --git a/resources/lang/en/auth/message.php b/resources/lang/en/auth/message.phpindex 3aee689e54..bebf9cdd48 100644--- a/resources/lang/en/auth/message.php+++ b/resources/lang/en/auth/message.php@@ -7,7 +7,7 @@ return array('account_not_activated' => 'This user account is not activated.','account_suspended' => 'This user account is suspended.','account_banned' => 'This user account is banned.',- 'throttle' => 'Too many failed login attempts. Please try again in :seconds seconds.',+ 'throttle' => 'Too many failed login attempts. Please try again in around :minutes minute(s).','signin' => array('error' => 'There was a problem while trying to log you in, please try again.',