Can clear 2FA login history from edit_user page
This commit is contained in:
@ -60,6 +60,7 @@ pub struct UpdateUserQuery {
|
||||
grant_type: String,
|
||||
granted_clients: String,
|
||||
two_factor: String,
|
||||
clear_2fa_history: Option<String>,
|
||||
}
|
||||
|
||||
pub async fn users_route(
|
||||
@ -114,10 +115,15 @@ pub async fn users_route(
|
||||
let temp_pass = rand_str(TEMPORARY_PASSWORDS_LEN);
|
||||
user.password = hash_password(&temp_pass).expect("Failed to hash password");
|
||||
user.need_reset_password = true;
|
||||
user.last_successful_2fa = Default::default();
|
||||
Some(temp_pass)
|
||||
}
|
||||
};
|
||||
|
||||
if update.0.clear_2fa_history.is_some() {
|
||||
user.last_successful_2fa = Default::default();
|
||||
}
|
||||
|
||||
let res = users
|
||||
.send(users_actor::UpdateUserRequest(user.clone()))
|
||||
.await
|
||||
|
Reference in New Issue
Block a user