User can delete his own 2FA login history
This commit is contained in:
@ -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>;
|
||||
|
||||
|
Reference in New Issue
Block a user