forked from Proxmox/proxmox
fix u2f context instantiation
don't use the appid for the origin if an origin was specified Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
c0312f3717
commit
54e97d35c1
@ -76,8 +76,12 @@ pub struct TfaConfig {
|
||||
|
||||
/// Helper to get a u2f instance from a u2f config, or `None` if there isn't one configured.
|
||||
fn get_u2f(u2f: &Option<U2fConfig>) -> Option<u2f::U2f> {
|
||||
u2f.as_ref()
|
||||
.map(|cfg| u2f::U2f::new(cfg.appid.clone(), cfg.appid.clone()))
|
||||
u2f.as_ref().map(|cfg| {
|
||||
u2f::U2f::new(
|
||||
cfg.appid.clone(),
|
||||
cfg.origin.clone().unwrap_or_else(|| cfg.appid.clone()),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
/// Helper to get a u2f instance from a u2f config.
|
||||
|
Loading…
x
Reference in New Issue
Block a user