diff --git a/src/api/core/two_factor/webauthn.rs b/src/api/core/two_factor/webauthn.rs index 51f85026..ba1a25fe 100644 --- a/src/api/core/two_factor/webauthn.rs +++ b/src/api/core/two_factor/webauthn.rs @@ -1,3 +1,18 @@ +use crate::{ + CONFIG, + api::{ + EmptyResult, JsonResult, PasswordOrOtpData, + core::{log_user_event, two_factor::generate_recover_code}, + }, + auth::Headers, + crypto::ct_eq, + db::{ + DbConn, + models::{EventType, TwoFactor, TwoFactorType, UserId}, + }, + error::Error, + util::NumberOrString, +}; use rocket::{Route, serde::json::Json}; use serde_json::Value; use std::{str::FromStr, sync::LazyLock}; @@ -26,22 +41,6 @@ pub static WEBAUTHN: LazyLock = LazyLock::new(|| { webauthn.build().expect("Building Webauthn failed") }); -use crate::{ - CONFIG, - api::{ - EmptyResult, JsonResult, PasswordOrOtpData, - core::{log_user_event, two_factor::generate_recover_code}, - }, - auth::Headers, - crypto::ct_eq, - db::{ - DbConn, - models::{EventType, TwoFactor, TwoFactorType, UserId}, - }, - error::Error, - util::NumberOrString, -}; - pub fn routes() -> Vec { routes![get_webauthn, generate_webauthn_challenge, activate_webauthn, activate_webauthn_put, delete_webauthn,] } diff --git a/src/api/core/webauthn.rs b/src/api/core/webauthn.rs index a8a7847e..6b6b1aa2 100644 --- a/src/api/core/webauthn.rs +++ b/src/api/core/webauthn.rs @@ -23,12 +23,12 @@ pub fn routes() -> Vec { #[get("/webauthn")] async fn get_webauthn(headers: Headers, conn: DbConn) -> JsonResult { if !CONFIG.passkey_login_allowed() { - // The web vault will query this endpoint weather passkey login is allowed, so we should return an empty list instead of an error. + // The web vault will query this endpoint whether passkey login is allowed or not, so we should return an empty list instead of an error. return Ok(Json(json!({ "object": "list", "data": [], "continuationToken": null - }))) + }))); } let user = headers.user;