I have a Auth.Attempt event handler class, which I detect user\'s login attempts to decide to lock user\'s account. However, when I tried to redirect user to login page with
Not getting to much into this very interesting discussion:
Should exceptions be used for flow control
You can try setting up your own exception handler and redirect from there on to the login page.
class FancyException extends Exception {}
App::error(function(FancyException $e, $code, $fromConsole)
{
$msg = $e->getMessage();
Log::error($msg);
if ( $fromConsole )
{
return 'Error '.$code.': '.$msg."\n";
}
if (Config::get('app.debug') == false) {
return Redirect::route('your.login.route');
}
else
{
//some debug stuff here
}
});
And in your function:
public function onLoginAttempt($data)
{
//detection process.......
// if login attempts more than max attempts
throw new FancyException("some msg here");
}