Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/lib/Rew/Controller/Root.pm b/lib/Rew/Controller/Root.pm
- index b69a22d..9124405 100644
- --- a/lib/Rew/Controller/Root.pm
- +++ b/lib/Rew/Controller/Root.pm
- @@ -43,7 +43,7 @@ sub auto : Private {
- $c->log->debug('***Root::auto User not found, forwarding to /login');
- # Redirect the user to the login page
- - $c->response->redirect( $c->uri_for('/login') );
- + $c->response->redirect( $c->uri_for('/login'), [], {continue_to => $c->req->uri} );
- # Return 0 to cancel 'post-auto' processing and prevent use of application
- return 0;
- diff --git a/lib/Rew/Controller/login.pm b/lib/Rew/Controller/login.pm
- index 80a2b10..7b73611 100644
- --- a/lib/Rew/Controller/login.pm
- +++ b/lib/Rew/Controller/login.pm
- @@ -10,6 +10,8 @@ sub index :Path :Args(0) {
- # Get the username and password from form
- my $username = $c->request->params->{username} || "";
- my $password = $c->request->params->{password} || "";
- + my $continue_to = $c->request->params->{continue_to} || $c->uri_for('/searches');
- +
- # If the username and password values were found in form
- if (defined($username) && defined($password)) {
- @@ -17,8 +19,7 @@ sub index :Path :Args(0) {
- if ($c->authenticate({ username => $username,
- password => $password } )) {
- # If successful, then let them use the application
- - $c->response->redirect($c->uri_for(
- - $c->controller('search')->action_for('index')));
- + $c->response->redirect( $continue_to );
- return;
- } else {
- # Set an error message
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement