tfa: improve user existence check
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
eab25e2f33
commit
4bda51688b
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user