X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=cgi-auth-flexible.pm;h=8eeea922f0ebd7e5b03347b2b1f44cb8f6d091c5;hb=3397af1fd7971910021122bf14d481abcf748fef;hp=8f0538fbf1931ddd87447e583995034dec08a845;hpb=0238b57dac39695fd01fce9e89b0456435964f5f;p=cgi-auth-flexible.git diff --git a/cgi-auth-flexible.pm b/cgi-auth-flexible.pm index 8f0538f..8eeea92 100644 --- a/cgi-auth-flexible.pm +++ b/cgi-auth-flexible.pm @@ -819,7 +819,9 @@ sub _check_divert_core ($) { return ({ Kind => 'REDIRECT-LOGGEDOUT', Message => $r->_gt("Logging out..."), _CookieRaw => '', - Params => { } }); + Params => { + $r->{S}{loggedout_param_names}[0] => [ 1 ], + } }); } if ($r->_ch('is_loggedout')) { die unless $meth eq 'GET'; @@ -1033,6 +1035,11 @@ sub check_divert ($) { my $cookraw = $r->{_CookieRaw}; $r->{CookieSecret} = $$cookraw; + if ($cookraw) { + $r->{Params}{$r->{S}{assoc_param_name}} = [ + $r->hash($cookraw) + ]; + } $r->_debug(Data::Dumper->Dump([$r->{Divert}],[qw(divert)])); return $r->{Divert}; @@ -1095,7 +1102,6 @@ sub check_ok ($) { # for redirects, we honour stored Params and Cookie, # as we would for non-divert if ($kind eq 'REDIRECT-LOGGEDOUT') { - $params->{$r->{S}{loggedout_param_names}[0]} = [ 1 ]; } elsif ($kind eq 'REDIRECT-LOGOUT') { $params->{$r->{S}{logout_param_names}[0]} = [ 1 ]; } elsif ($kind =~ m/REDIRECT-(?:LOGGEDIN|HTTPS)/) { @@ -1113,10 +1119,6 @@ sub check_ok ($) { return 0; } - if (defined $cookiesecret) { - $params->{$r->{S}{assoc_param_name}} = [ $r->hash($cookiesecret) ]; - } - my ($title, @body); if ($kind =~ m/^LOGIN-/) { $title = $r->_gt('Login');