Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Provide default for $redir_to #5

Open
wants to merge 1 commit into from

1 participant

@genehack

If you load '/login' directly there is no value set for $redir_to , as is undef as well.
This is the most sensible default value to provide.

@genehack genehack Provide default for $redir_to
If you load '/login' directly there is no value set for $redir_to , as
$tmp_redir is undef as well.  This is the most sensible default value
to provide.
e937c98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 22, 2012
  1. @genehack

    Provide default for $redir_to

    genehack authored
    If you load '/login' directly there is no value set for $redir_to , as
    $tmp_redir is undef as well.  This is the most sensible default value
    to provide.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Plack/Middleware/Auth/Form.pm
View
2  lib/Plack/Middleware/Auth/Form.pm
@@ -76,7 +76,7 @@ sub _login {
$env->{'psgix.session'}{remember} = ($params->get( 'remember' ) ? 1 : 0);
my $tmp_redir = delete $env->{'psgix.session'}{redir_to};
if( !defined($redir_to) ){
- $redir_to = $tmp_redir;
+ $redir_to = $tmp_redir || '/';
$redir_to = '/' if
URI->new( $redir_to )->path eq $env->{PATH_INFO};
}
Something went wrong with that request. Please try again.