]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1511466 - The /api/user/profile API should provide the user's MFA status
authorDylan William Hardison <dylan@hardison.net>
Thu, 6 Dec 2018 18:50:26 +0000 (13:50 -0500)
committerGitHub <noreply@github.com>
Thu, 6 Dec 2018 18:50:26 +0000 (13:50 -0500)
Bugzilla/Quantum/API.pm

index 929347f4734db4b29897c9c28a926080f1b5e17d..89a33a5d3b538aa01a682760298c646829dc5b92 100644 (file)
@@ -8,6 +8,7 @@
 package Bugzilla::Quantum::API;
 use 5.10.1;
 use Mojo::Base qw( Mojolicious::Controller );
+use Mojo::JSON qw( true false );
 
 sub setup_routes {
   my ($class, $r) = @_;
@@ -26,6 +27,8 @@ sub user_profile {
         login  => $user->login,
         nick   => $user->nick,
         groups => [map { $_->name } @{$user->groups}],
+        mfa    => $user->mfa,
+        mfa_required_by_group => $user->in_mfa_group ? true : false,
       }
     );
   }