User can delete his own 2FA login history
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

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

View File

@ -55,6 +55,10 @@ pub struct ChangePasswordResult(pub bool);
#[rtype(result = "bool")]
pub struct AddSuccessful2FALogin(pub UserID, pub IpAddr);
#[derive(Message)]
#[rtype(result = "bool")]
pub struct Clear2FALoginHistory(pub UserID);
#[derive(Debug)]
pub struct UpdateUserResult(pub bool);
@ -125,6 +129,13 @@ impl Handler<AddSuccessful2FALogin> for UsersActor {
}
}
impl Handler<Clear2FALoginHistory> for UsersActor {
type Result = <Clear2FALoginHistory as actix::Message>::Result;
fn handle(&mut self, msg: Clear2FALoginHistory, _ctx: &mut Self::Context) -> Self::Result {
self.manager.clear_2fa_login_history(&msg.0)
}
}
impl Handler<GetUserRequest> for UsersActor {
type Result = MessageResult<GetUserRequest>;