Can block local login for an account
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::net::IpAddr;
|
||||
|
||||
use crate::actors::users_actor::UsersSyncBackend;
|
||||
use crate::actors::users_actor::{AuthorizedAuthenticationSources, UsersSyncBackend};
|
||||
use crate::data::entity_manager::EntityManager;
|
||||
use crate::data::user::{FactorID, GeneralSettings, GrantedClients, TwoFactor, User, UserID};
|
||||
use crate::utils::err::{new_error, Res};
|
||||
@@ -143,6 +143,17 @@ impl UsersSyncBackend for EntityManager<User> {
|
||||
self.remove(&user)
|
||||
}
|
||||
|
||||
fn set_authorized_authentication_sources(
|
||||
&mut self,
|
||||
id: &UserID,
|
||||
sources: AuthorizedAuthenticationSources,
|
||||
) -> Res {
|
||||
self.update_user(id, |mut user| {
|
||||
user.allow_local_login = sources.local;
|
||||
user
|
||||
})
|
||||
}
|
||||
|
||||
fn set_granted_2fa_clients(&mut self, id: &UserID, clients: GrantedClients) -> Res {
|
||||
self.update_user(id, |mut user| {
|
||||
user.authorized_clients = clients.to_user();
|
||||
|
||||
Reference in New Issue
Block a user