Add default clients #105

Merged
pierre merged 9 commits from feat-default-client into master 2023-04-15 10:19:16 +00:00
Showing only changes of commit c13992e109 - Show all commits

View File

@ -56,15 +56,24 @@ pub struct WebAuthManager {
impl WebAuthManager { impl WebAuthManager {
pub fn init(conf: &AppConfig) -> Self { pub fn init(conf: &AppConfig) -> Self {
Self { let rp_id = conf
core: WebauthnBuilder::new( .domain_name()
conf.domain_name()
.split_once(':') .split_once(':')
.map(|s| s.0) .map(|s| s.0)
.unwrap_or_else(|| conf.domain_name()), .unwrap_or_else(|| conf.domain_name());
&url::Url::parse(&conf.website_origin)
.expect("Failed to parse configuration origin!"), 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") .expect("Invalid Webauthn configuration")
.rp_name(APP_NAME) .rp_name(APP_NAME)
.build() .build()