Skip to content

Commit

Permalink
adding a login failed redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisFrench committed Jul 26, 2015
1 parent 8e21fc4 commit 3473b4a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Users/Site/Controllers/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,16 @@ public function auth()
}
catch ( \Exception $e )
{
$redirect = '/login';
if ($custom_redirect = \Dsc\System::instance()->get( 'session' )->get( 'site.login.failed.redirect' ))
{
$redirect = $custom_redirect;
}

\Dsc\System::addMessage( $e->getMessage(), 'error' );
\Base::instance()->reroute( "/login" );
\Dsc\System::instance()->get( 'session' )->set( 'site.login.failed.redirect', null );
\Base::instance()->reroute( $redirect );

return;
}

Expand Down

0 comments on commit 3473b4a

Please sign in to comment.