summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/User.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/WebService/User.pm')
-rw-r--r--Bugzilla/WebService/User.pm18
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;