Skip to content

Commit

Permalink
refactor use two_factor to top
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan0xC committed Oct 21, 2023
1 parent 6f1001b commit 8a00ed9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/api/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
api::{
core::accounts::{PreloginData, RegisterData, _prelogin, _register},
core::log_user_event,
core::two_factor::{duo, email, email::EmailTokenData, yubikey},
core::two_factor::{self as _tf, duo, email, email::EmailTokenData, yubikey},
ApiResult, EmptyResult, JsonResult, JsonUpcase,
},
auth::{generate_organization_api_key_login_claims, ClientHeaders, ClientIp},
Expand Down Expand Up @@ -479,7 +479,6 @@ async fn twofactor_auth(

let selected_twofactor = twofactors.into_iter().find(|tf| tf.atype == selected_id && tf.enabled);

use crate::api::core::two_factor as _tf;
use crate::crypto::ct_eq;

let selected_data = _selected_data(selected_twofactor);
Expand Down Expand Up @@ -584,8 +583,6 @@ async fn _json_err_twofactor(providers: &[i32], user_uuid: &str, conn: &mut DbCo
}

Some(tf_type @ TwoFactorType::Email) => {
use crate::api::core::two_factor as _tf;

let twofactor = match TwoFactor::find_by_user_and_type(user_uuid, tf_type as i32, conn).await {
Some(tf) => tf,
None => err!("No twofactor email registered"),
Expand Down

0 comments on commit 8a00ed9

Please sign in to comment.