Rename SecondFactor
=> TwoFactor
This commit is contained in:
@ -6,7 +6,7 @@ use crate::actors::users_actor;
|
||||
use crate::actors::users_actor::UsersActor;
|
||||
use crate::data::current_user::CurrentUser;
|
||||
use crate::data::totp_key::TotpKey;
|
||||
use crate::data::user::{FactorID, SecondFactor, SecondFactorType, User};
|
||||
use crate::data::user::{FactorID, TwoFactor, TwoFactorType, User};
|
||||
|
||||
#[derive(serde::Deserialize)]
|
||||
pub struct AddTOTPRequest {
|
||||
@ -31,10 +31,10 @@ pub async fn save_totp_factor(user: CurrentUser, form: web::Json<AddTOTPRequest>
|
||||
}
|
||||
|
||||
let mut user = User::from(user);
|
||||
user.add_factor(SecondFactor {
|
||||
user.add_factor(TwoFactor {
|
||||
id: FactorID(Uuid::new_v4().to_string()),
|
||||
name: form.0.factor_name,
|
||||
kind: SecondFactorType::TOTP(key),
|
||||
kind: TwoFactorType::TOTP(key),
|
||||
});
|
||||
let res = users.send(users_actor::UpdateUserRequest(user)).await.unwrap().0;
|
||||
|
||||
|
Reference in New Issue
Block a user