diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-03-10 19:32:45 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-03-10 19:32:45 +0100 |
commit | 5970a5a350890340821a5418f3aa4607e05f49cb (patch) | |
tree | db97fe2421a3fd1d354481ef8d6e5224094486ca /index.pl | |
parent | c27c108f4862f5dcbf42cf8f403807d7cbb009f1 (diff) |
redirect users after login to protected page
Diffstat (limited to 'index.pl')
-rwxr-xr-x | index.pl | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -920,7 +920,7 @@ post '/login' => sub { } else { if ( $self->authenticate( $user, $password ) ) { - $self->redirect_to('/'); + $self->redirect_to( $self->req->param('redirect_to') // '/' ); } else { my $data = $self->get_user_password($user); @@ -1173,7 +1173,7 @@ under sub { if ( $self->is_user_authenticated ) { return 1; } - $self->render('login'); + $self->render( 'login', redirect_to => $self->req->url ); return undef; }; |