From d3f357b7089fc649ff95eb067cd061e2fc3a608b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 13 Aug 2018 15:26:01 +0200 Subject: [PATCH] Implemented PUT for u2f registration --- src/api/core/mod.rs | 1 + src/api/core/two_factor.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/api/core/mod.rs b/src/api/core/mod.rs index 2a74581..4d37f24 100644 --- a/src/api/core/mod.rs +++ b/src/api/core/mod.rs @@ -73,6 +73,7 @@ pub fn routes() -> Vec { activate_authenticator_put, generate_u2f, activate_u2f, + activate_u2f_put, get_organization, create_organization, diff --git a/src/api/core/two_factor.rs b/src/api/core/two_factor.rs index 67088aa..875dec2 100644 --- a/src/api/core/two_factor.rs +++ b/src/api/core/two_factor.rs @@ -374,6 +374,11 @@ fn activate_u2f(data: JsonUpcase, headers: Headers, conn: DbConn) } } +#[put("/two-factor/u2f", data = "")] +fn activate_u2f_put(data: JsonUpcase, headers: Headers, conn: DbConn) -> JsonResult { + activate_u2f(data,headers, conn) +} + fn _create_u2f_challenge(user_uuid: &str, type_: TwoFactorType, conn: &DbConn) -> Challenge { let challenge = U2F.generate_challenge().unwrap();