fix: repair login endpoint registration in auth router
This commit is contained in:
@@ -16,7 +16,7 @@ import subprocess
|
||||
from .. import models, schemas, database, auth
|
||||
from ..logger import log
|
||||
|
||||
router = APIRouter(prefix="/auth", tags=["auth"])
|
||||
router = APIRouter(prefix="/users", tags=["auth"])
|
||||
limiter = Limiter(key_func=get_remote_address)
|
||||
pwd_context = CryptContext(schemes=["pbkdf2_sha256"], deprecated="auto")
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class TestUserAuthentication:
|
||||
}
|
||||
with patch("backend.routers.auth.get_ldap_config", return_value=ldap_config):
|
||||
response = test_client.post(
|
||||
"/auth/login",
|
||||
"/users/login",
|
||||
json={"username": "testuser", "password": "password123"}
|
||||
)
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
@@ -46,7 +46,7 @@ class TestUserAuthentication:
|
||||
patch("backend.routers.auth.ldap3.Server"), \
|
||||
patch("backend.routers.auth.ldap3.Connection", side_effect=Exception("Invalid credentials")):
|
||||
response = test_client.post(
|
||||
"/auth/login",
|
||||
"/users/login",
|
||||
json={"username": "testuser", "password": "wrongpassword"}
|
||||
)
|
||||
assert response.status_code == status.HTTP_401_UNAUTHORIZED
|
||||
@@ -67,7 +67,7 @@ class TestUserAuthentication:
|
||||
test_db.commit()
|
||||
|
||||
response = test_client.post(
|
||||
"/auth/login",
|
||||
"/users/login",
|
||||
json={"username": "localuser", "password": "password123"}
|
||||
)
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
|
||||
Reference in New Issue
Block a user