diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-10-24 10:40:49 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-10-30 15:16:02 +0000 |
commit | 5a3e4c05be9e8eb931fccbcf6499abcc1da8d903 (patch) | |
tree | 3d6f4538275c5c9b0fa6b5c77dad870eeb3311bf /perllib/FixMyStreet/App/Controller | |
parent | e8adf97e7f01efdaab2f0ab3181268d07640c3f4 (diff) |
Allow enforcement of 2FA for staff users.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth.pm | 5 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth/Profile.pm | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm index 9680a5624..2aa1144a0 100644 --- a/perllib/FixMyStreet/App/Controller/Auth.pm +++ b/perllib/FixMyStreet/App/Controller/Auth.pm @@ -540,6 +540,11 @@ sub check_auth : Local { return; } +sub two_factor_setup_success : Private { + my ($self, $c) = @_; + # Only here to be detached to after setup success +} + __PACKAGE__->meta->make_immutable; 1; diff --git a/perllib/FixMyStreet/App/Controller/Auth/Profile.pm b/perllib/FixMyStreet/App/Controller/Auth/Profile.pm index 8512e7562..91ffac205 100644 --- a/perllib/FixMyStreet/App/Controller/Auth/Profile.pm +++ b/perllib/FixMyStreet/App/Controller/Auth/Profile.pm @@ -195,6 +195,7 @@ sub generate_token : Path('/auth/generate_token') { my $action = $c->get_param('2fa_action') || ''; $action = 'deactivate' if $c->get_param('2fa_deactivate'); $action = 'activate' if $c->get_param('2fa_activate'); + $action = 'activate' if $action eq 'deactivate' && $has_2fa && $c->cobrand->call_hook('must_have_2fa', $c->user); my $secret; if ($action eq 'deactivate') { |