Permalink
Browse files

fix this to use redirect rather than forward

  • Loading branch information...
Luke Closs
Luke Closs committed Jul 18, 2012
1 parent c8ec8e7 commit 1333fe0e9669b7397a0cda6a1d84edad271c0a96
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/Biopay.pm
View
@@ -70,10 +70,9 @@ hook before => sub {
}
debug "no bio session, redirecting to login (from $path)";
- forward ($path =~ m{^/member/} ? '/login' : '/admin-login'), {
- message => "Please log-in first.",
- path => $path,
- }, { method => 'GET' };
+ session message => 'Please log-in first.';
+ session path => $path;
+ return redirect $path =~ m{^/member/} ? '/login' : '/admin-login';
};
get '/' => sub {
@@ -138,8 +137,10 @@ get '/stats-widget.js' => sub {
};
get '/login' => sub {
+ my $msg = param('message') || session('message') || '';
+ session 'message' => '' if $msg;
template 'login' => {
- message => param('message') || '',
+ message => $msg,
path => param('path') || session('path'),
};
};

0 comments on commit 1333fe0

Please sign in to comment.