From 5cdffac4f5d68ed78abe24d045f02cc33ea07ee5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 25 Oct 2015 13:25:44 +0000 Subject: [PATCH] blinding: Move setting of Params into check_divert 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 --- cgi-auth-flexible.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cgi-auth-flexible.pm b/cgi-auth-flexible.pm index 8f0538f..7542b21 100644 --- a/cgi-auth-flexible.pm +++ b/cgi-auth-flexible.pm @@ -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'); -- 2.30.2