commit d5ed2ce6df073ce49340748e2d200b951de3f2c9
parent 612c0e9478adedbddaa89b96bc5648b0df84cb4d
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Mon, 6 Sep 2021 17:17:04 +0200
Merge branch 'jjlin-webauthn-origin' into main
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/api/core/two_factor/webauthn.rs b/src/api/core/two_factor/webauthn.rs
@@ -22,12 +22,14 @@ pub fn routes() -> Vec<Route> {
struct WebauthnConfig {
url: String,
+ origin: String,
rpid: String,
}
impl WebauthnConfig {
fn load() -> Webauthn<Self> {
let domain = CONFIG.domain();
+ let domain_origin = CONFIG.domain_origin();
Webauthn::new(Self {
rpid: reqwest::Url::parse(&domain)
.map(|u| u.domain().map(str::to_owned))
@@ -35,6 +37,7 @@ impl WebauthnConfig {
.flatten()
.unwrap_or_default(),
url: domain,
+ origin: domain_origin,
})
}
}
@@ -45,7 +48,7 @@ impl webauthn_rs::WebauthnConfig for WebauthnConfig {
}
fn get_origin(&self) -> &str {
- &self.url
+ &self.origin
}
fn get_relying_party_id(&self) -> &str {