]> git.proxmox.com Git - pve-access-control.git/commitdiff
api: user index: only include existing tfa lock flags
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 6 Jun 2023 09:18:56 +0000 (11:18 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 6 Jun 2023 09:19:00 +0000 (11:19 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/API2/User.pm

index 385c1001aca7c7cacf61a4938c6655e66ef18692..d2b6bf718641da21f8d429c2c831c909de0f110d 100644 (file)
@@ -221,7 +221,9 @@ __PACKAGE__->register_method ({
 
            if (defined($tfa_cfg)) {
                if (my $data = $tfa_cfg->tfa_lock_status($user)) {
-                   $entry->{$_} = $data->{$_} for qw(totp-locked tfa-locked-until);
+                   for (qw(totp-locked tfa-locked-until)) {
+                       $entry->{$_} = $data->{$_} if exists($data->{$_});
+                   }
                }
            }