aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Auth.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-07-05 13:09:18 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-07-06 13:04:12 +0100
commitf74c7910b72f41f4a72d8b6b1a683fcf9fbb244e (patch)
tree6e45c3c4b43e23dd9138fa8f6018de24f1293819 /perllib/FixMyStreet/App/Controller/Auth.pm
parent9d8ae07980bccd58e11acbc82e60b651ed20c181 (diff)
Fix CSRF issue with new login during process.
If you had no session cookie, started reporting a problem, logged in through that process, you would then get a CSRF error as the token had been created before the session was.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Auth.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Auth.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm
index 65533b1d2..be95040e1 100644
--- a/perllib/FixMyStreet/App/Controller/Auth.pm
+++ b/perllib/FixMyStreet/App/Controller/Auth.pm
@@ -85,6 +85,9 @@ sub sign_in : Private {
$c->set_session_cookie_expire(0)
unless $remember_me;
+ # Regenerate CSRF token as session ID changed
+ $c->forward('get_csrf_token');
+
return 1;
}