User can delete his own 2FA login history

This commit is contained in:
2022-11-12 11:50:32 +01:00
parent 7887ccaa41
commit cc4a8a962b
5 changed files with 80 additions and 20 deletions

@ -120,3 +120,15 @@ pub async fn delete_factor(
HttpResponse::Ok().body("Removed factor!")
}
}
pub async fn clear_login_history(
user: CurrentUser,
users: web::Data<Addr<UsersActor>>,
) -> impl Responder {
users
.send(users_actor::Clear2FALoginHistory(user.uid.clone()))
.await
.unwrap();
HttpResponse::Ok().body("History successfully cleared")
}