1
0
Fork 0
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:
Daniel García 2021-10-24 21:50:26 +02:00
parent 53cc8a65af
commit 97f9eb1320
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
3 changed files with 42 additions and 65 deletions

View file

@ -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
}