mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-12-03 22:01:50 +00:00
fix(oidc): Check login disable flag for OIDC logins
This commit is contained in:
2 files changed
+7
-1
No files matched your search
@@ -77,7 +77,7 @@ async fn handle_login(
|
||||
|
||||
if services.users.is_login_disabled(&user_id).await {
|
||||
warn!(%user_id, "user attempted to log in with a login-disabled account");
|
||||
return Err!(Request(Forbidden("This account is not permitted to log in.")));
|
||||
return Err!(Request(Forbidden("This account is blocked from logging in.")));
|
||||
}
|
||||
|
||||
services.users.check_password(&user_id, password).await
|
||||
|
||||
@@ -185,6 +185,12 @@ async fn route_complete(
|
||||
.remove::<IgnoredAny>(OIDC_SESSION_ID_KEY)
|
||||
.await;
|
||||
|
||||
if services.users.is_login_disabled(&user_id).await {
|
||||
return Err(WebError::Forbidden(
|
||||
"This account is blocked from logging in.".to_owned(),
|
||||
));
|
||||
}
|
||||
|
||||
let user_session = UserSession { user_id, last_login: SystemTime::now() };
|
||||
|
||||
session_store
|
||||
|
||||
Reference in new issue
Block a user