mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-27 22:13:56 +00:00
Update dependencies
This commit is contained in:
parent
53cc8a65af
commit
97f9eb1320
3 changed files with 42 additions and 65 deletions
|
@ -1,6 +1,7 @@
|
|||
use rocket::Route;
|
||||
use rocket_contrib::json::Json;
|
||||
use serde_json::Value;
|
||||
use url::Url;
|
||||
use webauthn_rs::{base64_data::Base64UrlSafeData, proto::*, AuthenticationState, RegistrationState, Webauthn};
|
||||
|
||||
use crate::{
|
||||
|
@ -22,7 +23,7 @@ pub fn routes() -> Vec<Route> {
|
|||
|
||||
struct WebauthnConfig {
|
||||
url: String,
|
||||
origin: String,
|
||||
origin: Url,
|
||||
rpid: String,
|
||||
}
|
||||
|
||||
|
@ -31,13 +32,13 @@ impl WebauthnConfig {
|
|||
let domain = CONFIG.domain();
|
||||
let domain_origin = CONFIG.domain_origin();
|
||||
Webauthn::new(Self {
|
||||
rpid: reqwest::Url::parse(&domain)
|
||||
rpid: Url::parse(&domain)
|
||||
.map(|u| u.domain().map(str::to_owned))
|
||||
.ok()
|
||||
.flatten()
|
||||
.unwrap_or_default(),
|
||||
url: domain,
|
||||
origin: domain_origin,
|
||||
origin: Url::parse(&domain_origin).unwrap(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +48,7 @@ impl webauthn_rs::WebauthnConfig for WebauthnConfig {
|
|||
&self.url
|
||||
}
|
||||
|
||||
fn get_origin(&self) -> &str {
|
||||
fn get_origin(&self) -> &Url {
|
||||
&self.origin
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue