diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-11-29 18:01:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-29 18:01:32 +0100 |
commit | 7d57b38aefe92683d8afe558fde7e1464837baba (patch) | |
tree | ad725a38065395338b8d09c4f98e6b35a7a0cadd | |
parent | 064427551b0dfd6a383f59367d1efd16a86d5251 (diff) | |
download | bugzilla-7d57b38aefe92683d8afe558fde7e1464837baba.tar.gz bugzilla-7d57b38aefe92683d8afe558fde7e1464837baba.tar.xz |
Bug 1393950 - Block users from signing into Phabricator unless they have MFA enabled
-rw-r--r-- | Bugzilla/WebService/User.pm | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Bugzilla/WebService/User.pm b/Bugzilla/WebService/User.pm index 11a9e4b31..5f9b54787 100644 --- a/Bugzilla/WebService/User.pm +++ b/Bugzilla/WebService/User.pm @@ -418,18 +418,22 @@ sub mfa_enroll { my $user = Bugzilla->login(LOGIN_REQUIRED); $user->set_mfa($provider_name); - my $provider = $user->mfa_provider // die "Unknown MTA provider\n"; + my $provider = $user->mfa_provider // die "Unknown MFA provider\n"; return $provider->enroll_api(); } sub whoami { - my ($self, $params) = @_; + my ( $self, $params ) = @_; my $user = Bugzilla->login(LOGIN_REQUIRED); - return filter $params, { - id => $self->type('int', $user->id), - real_name => $self->type('string', $user->name), - name => $self->type('email', $user->login), - }; + return filter( + $params, + { + id => $self->type( 'int', $user->id ), + real_name => $self->type( 'string', $user->name ), + name => $self->type( 'email', $user->login ), + mfa_status => $self->type( 'boolean', !!$user->mfa ), + } + ); } 1; |