tfa: improve user existence check

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2020-12-18 14:12:03 +01:00
parent eab25e2f33
commit 4bda51688b

View File

@ -33,7 +33,10 @@ fn tfa_update_auth(
if must_exist && authid.user() != userid { if must_exist && authid.user() != userid {
let (config, _digest) = crate::config::user::config()?; let (config, _digest) = crate::config::user::config()?;
if config.sections.get(userid.as_str()).is_none() { if config
.lookup::<crate::config::user::User>("user", userid.as_str())
.is_err()
{
bail!("user '{}' does not exists.", userid); bail!("user '{}' does not exists.", userid);
} }
} }