chiark / gitweb /
blinding: Move setting of Params into check_divert
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 25 Oct 2015 13:25:44 +0000 (13:25 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 25 Oct 2015 13:25:44 +0000 (13:25 +0000)
Previously, divert_ok had the knowledge of the need to set
assoc_param_name in some cases.  Put this into check_divert.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
cgi-auth-flexible.pm

index 8f0538f..7542b21 100644 (file)
@@ -1033,6 +1033,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};
@@ -1113,10 +1118,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');