From 53a2b71563d77bfe6fdaaa209522ec43725cf1f0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 6 Jun 2023 11:18:56 +0200 Subject: [PATCH] api: user index: only include existing tfa lock flags Signed-off-by: Wolfgang Bumiller --- src/PVE/API2/User.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PVE/API2/User.pm b/src/PVE/API2/User.pm index 385c100..d2b6bf7 100644 --- a/src/PVE/API2/User.pm +++ b/src/PVE/API2/User.pm @@ -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->{$_}); + } } } -- 2.39.2