mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 00:27:41 +01:00
Remove disabled login check from login endpoint
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user