Can force 2FA authent
This commit is contained in:
@ -16,6 +16,7 @@ pub struct AuthWebauthnRequest {
|
||||
credential: PublicKeyCredential,
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn auth_webauthn(
|
||||
id: Identity,
|
||||
req: web::Json<AuthWebauthnRequest>,
|
||||
@ -25,10 +26,6 @@ pub async fn auth_webauthn(
|
||||
users: web::Data<Addr<UsersActor>>,
|
||||
logger: ActionLogger,
|
||||
) -> impl Responder {
|
||||
if !SessionIdentity(Some(&id)).need_2fa_auth() {
|
||||
return HttpResponse::Unauthorized().json("No 2FA required!");
|
||||
}
|
||||
|
||||
let user_id = SessionIdentity(Some(&id)).user_id();
|
||||
|
||||
match manager.finish_authentication(&user_id, &req.opaque_state, &req.credential) {
|
||||
|
Reference in New Issue
Block a user