diff --git a/src/api/core/two_factor/webauthn.rs b/src/api/core/two_factor/webauthn.rs index d8f6feea..f0bd912c 100644 --- a/src/api/core/two_factor/webauthn.rs +++ b/src/api/core/two_factor/webauthn.rs @@ -130,6 +130,10 @@ async fn get_webauthn(data: Json, headers: Headers, conn: DbC #[post("/two-factor/get-webauthn-challenge", data = "")] async fn generate_webauthn_challenge(data: Json, headers: Headers, conn: DbConn) -> JsonResult { + if !CONFIG.is_webauthn_2fa_supported() { + err!("Configured `DOMAIN` is not compatible with Webauthn") + } + let data: PasswordOrOtpData = data.into_inner(); let user = headers.user; @@ -256,6 +260,10 @@ impl From for PublicKeyCredential { #[post("/two-factor/webauthn", data = "")] async fn activate_webauthn(data: Json, headers: Headers, conn: DbConn) -> JsonResult { + if !CONFIG.is_webauthn_2fa_supported() { + err!("Configured `DOMAIN` is not compatible with Webauthn") + } + let data: EnableWebauthnData = data.into_inner(); let mut user = headers.user;