From db26248f04c80fad63dbdae609cc6d7bed5a7fb8 Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Fri, 21 Mar 2025 14:58:47 -0400 Subject: [PATCH] Remove disabled login check from login endpoint --- backend/endpoints/auth.py | 6 +----- backend/exceptions/auth_exceptions.py | 5 ----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/backend/endpoints/auth.py b/backend/endpoints/auth.py index fca8b07de..4bb8c9626 100644 --- a/backend/endpoints/auth.py +++ b/backend/endpoints/auth.py @@ -1,7 +1,7 @@ from datetime import datetime, timedelta, timezone from typing import Annotated, Final -from config import DISABLE_USERPASS_LOGIN, OIDC_ENABLED, OIDC_REDIRECT_URI +from config import OIDC_ENABLED, OIDC_REDIRECT_URI from decorators.auth import oauth from endpoints.forms.identity import OAuth2RequestForm from endpoints.responses import MessageResponse @@ -11,7 +11,6 @@ from exceptions.auth_exceptions import ( OIDCDisabledException, OIDCNotConfiguredException, UserDisabledException, - UserPassDisabledException, ) from fastapi import Depends, HTTPException, Request, status from fastapi.responses import RedirectResponse @@ -48,9 +47,6 @@ def login( MessageResponse: Standard message response """ - if DISABLE_USERPASS_LOGIN: - raise UserPassDisabledException - user = auth_handler.authenticate_user(credentials.username, credentials.password) if not user: raise AuthCredentialsException diff --git a/backend/exceptions/auth_exceptions.py b/backend/exceptions/auth_exceptions.py index e49c41fbb..66db919bf 100644 --- a/backend/exceptions/auth_exceptions.py +++ b/backend/exceptions/auth_exceptions.py @@ -1,10 +1,5 @@ from fastapi import HTTPException, status -UserPassDisabledException = HTTPException( - status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, - detail="Username/password authentication disabled", -) - AuthCredentialsException = HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, detail="Incorrect username or password",