api: user index: only include existing tfa lock flags

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2023-06-06 11:18:56 +02:00
parent f63364a755
commit 53a2b71563

View 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->{$_});
}
}
}