aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Auth.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-02-07 13:09:45 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-02-07 13:09:45 +0000
commit7361782de3d072f8d09442e33aa9c42a7c181c4c (patch)
tree5b8f49a13eb6f3aeb152262cbe66d55a48c4924d /perllib/FixMyStreet/App/Controller/Auth.pm
parent6879af98d0246b6973affff08a4e078206bb5dfc (diff)
parent3e721ddf5d9809c9f44d7dedcf2083a544e6e148 (diff)
Merge branch '2fa-superuser'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Auth.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Auth.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm
index 95f8bb9a2..533e6a9be 100644
--- a/perllib/FixMyStreet/App/Controller/Auth.pm
+++ b/perllib/FixMyStreet/App/Controller/Auth.pm
@@ -243,6 +243,9 @@ sub process_login : Private {
$c->detach( '/page_error_403_access_denied', [] )
if FixMyStreet->config('SIGNUPS_DISABLED') && !$user->in_storage && !$data->{old_user_id};
+ # Superusers using 2FA can not log in by code
+ $c->detach( '/page_error_403_access_denied', [] ) if $user->has_2fa;
+
if ($data->{old_user_id}) {
# Were logged in as old_user_id, want to switch to $user
if ($user->in_storage) {
@@ -281,6 +284,11 @@ Used after signing in to take the person back to where they were.
sub redirect_on_signin : Private {
my ( $self, $c, $redirect, $params ) = @_;
+
+ if ($c->stash->{detach_to}) {
+ $c->detach($c->stash->{detach_to}, $c->stash->{detach_args});
+ }
+
unless ( $redirect ) {
$c->detach('redirect_to_categories') if $c->user->from_body && scalar @{ $c->user->categories };
$redirect = 'my';