Can block local login for an account
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-04-24 18:46:21 +02:00
parent 96ffc669d7
commit f64f01a958
7 changed files with 140 additions and 15 deletions

View File

@@ -132,7 +132,7 @@ pub async fn login_route(
else if let Some(req) = &req {
login = req.login.clone();
let response: LoginResult = users
.send(users_actor::LoginRequest {
.send(users_actor::LocalLoginRequest {
login: login.clone(),
password: req.password.clone(),
})
@@ -163,6 +163,12 @@ pub async fn login_route(
danger = Some("Your account is disabled!".to_string());
}
LoginResult::LocalAuthForbidden => {
log::warn!("Failed login for username {} : attempted to use local auth, but it is forbidden", &login);
logger.log(Action::TryLocalLoginFromUnauthorizedAccount(&login));
danger = Some("You cannot login from local auth with your account!".to_string());
}
LoginResult::Error => {
danger = Some("An unkown error occured while trying to sign you in!".to_string());
}