Help debug Webauthn configuration
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
d5b58e471d
commit
c13992e109
@ -56,15 +56,24 @@ pub struct WebAuthManager {
|
||||
|
||||
impl WebAuthManager {
|
||||
pub fn init(conf: &AppConfig) -> Self {
|
||||
Self {
|
||||
core: WebauthnBuilder::new(
|
||||
conf.domain_name()
|
||||
let rp_id = conf
|
||||
.domain_name()
|
||||
.split_once(':')
|
||||
.map(|s| s.0)
|
||||
.unwrap_or_else(|| conf.domain_name()),
|
||||
&url::Url::parse(&conf.website_origin)
|
||||
.expect("Failed to parse configuration origin!"),
|
||||
)
|
||||
.unwrap_or_else(|| conf.domain_name());
|
||||
|
||||
let rp_origin =
|
||||
url::Url::parse(&conf.website_origin).expect("Failed to parse configuration origin!");
|
||||
|
||||
log::debug!(
|
||||
"rp_id={} rp_origin={} rp_origin_domain={:?}",
|
||||
rp_id,
|
||||
rp_origin,
|
||||
rp_origin.domain()
|
||||
);
|
||||
|
||||
Self {
|
||||
core: WebauthnBuilder::new(rp_id, &rp_origin)
|
||||
.expect("Invalid Webauthn configuration")
|
||||
.rp_name(APP_NAME)
|
||||
.build()
|
||||
|
Loading…
Reference in New Issue
Block a user