Update v1.0.6.10

This commit is contained in:
sujitprasad
2016-04-01 10:37:46 +05:30
parent d8400d6d79
commit ce796d2a89
10 changed files with 562 additions and 81 deletions

View File

@@ -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
}