Advertisement
Guest User

Untitled

a guest
May 3rd, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. diff --git a/lib/Rew/Controller/Root.pm b/lib/Rew/Controller/Root.pm
  2. index b69a22d..9124405 100644
  3. --- a/lib/Rew/Controller/Root.pm
  4. +++ b/lib/Rew/Controller/Root.pm
  5. @@ -43,7 +43,7 @@ sub auto : Private {
  6. $c->log->debug('***Root::auto User not found, forwarding to /login');
  7.  
  8. # Redirect the user to the login page
  9. - $c->response->redirect( $c->uri_for('/login') );
  10. + $c->response->redirect( $c->uri_for('/login'), [], {continue_to => $c->req->uri} );
  11.  
  12. # Return 0 to cancel 'post-auto' processing and prevent use of application
  13. return 0;
  14. diff --git a/lib/Rew/Controller/login.pm b/lib/Rew/Controller/login.pm
  15. index 80a2b10..7b73611 100644
  16. --- a/lib/Rew/Controller/login.pm
  17. +++ b/lib/Rew/Controller/login.pm
  18. @@ -10,6 +10,8 @@ sub index :Path :Args(0) {
  19. # Get the username and password from form
  20. my $username = $c->request->params->{username} || "";
  21. my $password = $c->request->params->{password} || "";
  22. + my $continue_to = $c->request->params->{continue_to} || $c->uri_for('/searches');
  23. +
  24.  
  25. # If the username and password values were found in form
  26. if (defined($username) && defined($password)) {
  27. @@ -17,8 +19,7 @@ sub index :Path :Args(0) {
  28. if ($c->authenticate({ username => $username,
  29. password => $password } )) {
  30. # If successful, then let them use the application
  31. - $c->response->redirect($c->uri_for(
  32. - $c->controller('search')->action_for('index')));
  33. + $c->response->redirect( $continue_to );
  34. return;
  35. } else {
  36. # Set an error message
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement