Update v1.0.6.10
This commit is contained in:
@@ -16,6 +16,7 @@ use Hash;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\Registrar;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||
use Lang;
|
||||
use Mail;
|
||||
|
||||
/**
|
||||
@@ -177,7 +178,7 @@ class AuthController extends Controller
|
||||
$field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name';
|
||||
// If attempts > 3 and time < 10 minutes
|
||||
if ($loginAttempts > 4 && (time() - $loginAttemptTime <= 600)) {
|
||||
return redirect()->back()->with('error', 'Maximum login attempts reached. Try again in a while');
|
||||
return redirect()->back()->withErrors('email', 'incorrect email')->with('error', 'Maximum login attempts reached. Try again in a while');
|
||||
}
|
||||
// If time > 10 minutes, reset attempts counter and time in session
|
||||
if (time() - $loginAttemptTime > 600) {
|
||||
@@ -198,12 +199,12 @@ class AuthController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return redirect($this->loginPath())
|
||||
return redirect()->back()
|
||||
->withInput($request->only('email', 'remember'))
|
||||
->withErrors([
|
||||
'email' => $this->getFailedLoginMessage(),
|
||||
'password' => $this->getFailedLoginMessage(),
|
||||
]);
|
||||
])->with('error', Lang::get('lang.invalid'));
|
||||
// Increment login attempts
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user