mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-08-05 13:23:21 +00:00
store the tfa type in user.cfg
This allows some improvements to the user experience on the web ui. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9fbad01207
commit
7e58c66de2
@ -1434,7 +1434,7 @@ sub user_set_tfa {
|
||||
$tfa->{data} = $data;
|
||||
cfs_write_file('priv/tfa.cfg', $tfa_cfg);
|
||||
|
||||
$user->{keys} = 'x';
|
||||
$user->{keys} = "x!$type";
|
||||
} else {
|
||||
delete $tfa_cfg->{users}->{$userid};
|
||||
cfs_write_file('priv/tfa.cfg', $tfa_cfg);
|
||||
@ -1463,7 +1463,8 @@ sub user_get_tfa {
|
||||
$realm_tfa = PVE::Auth::Plugin::parse_tfa_config($realm_tfa)
|
||||
if $realm_tfa;
|
||||
|
||||
if ($keys ne 'x') {
|
||||
# new style config starts with an 'x' and optionally contains a !<type> suffix
|
||||
if ($keys != /^x(?:!.*)?$/) {
|
||||
# old style config, find the type via the realm
|
||||
return if !$realm_tfa;
|
||||
return ($realm_tfa->{type}, {
|
||||
|
Loading…
Reference in New Issue
Block a user