From 44c2e5dc8f49760d3a9628e91649fb77cc8089ed Mon Sep 17 00:00:00 2001 From: Vaishnavi10706 Date: Sun, 26 Jul 2026 19:53:30 +0530 Subject: [PATCH 1/2] fix(auth): remove password min_length validation from LoginRequest --- backend/app/schemas.py | 1 - backend/tests/test_auth_endpoints.py | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/app/schemas.py b/backend/app/schemas.py index f755ae72..be0af6be 100644 --- a/backend/app/schemas.py +++ b/backend/app/schemas.py @@ -381,7 +381,6 @@ class LoginRequest(BaseModel): ) password: str = Field( ..., - min_length=8, max_length=128, description="The account password.", example="supersecret123", diff --git a/backend/tests/test_auth_endpoints.py b/backend/tests/test_auth_endpoints.py index 88e9bfd9..d6ecc7d6 100644 --- a/backend/tests/test_auth_endpoints.py +++ b/backend/tests/test_auth_endpoints.py @@ -99,7 +99,17 @@ def test_signup_login_and_me_happy_path(client): "user_id": signup_data["user_id"], "email": "new.user@example.com", } + +def test_login_short_password_not_rejected_by_schema(client): + response = client.post( + "/auth/login", + json={ + "email": "user@example.com", + "password": "short", + }, + ) + assert response.status_code != 422 def test_signup_duplicate_email_returns_409(client): payload = {"email": "dup@example.com", "password": "StrongPass123!"} From afd6a3cdce99b109633dfe5ca6bd259737f1dca8 Mon Sep 17 00:00:00 2001 From: Vaishnavi10706 Date: Mon, 27 Jul 2026 20:20:16 +0530 Subject: [PATCH 2/2] style: format auth endpoint tests --- backend/tests/test_auth_endpoints.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/tests/test_auth_endpoints.py b/backend/tests/test_auth_endpoints.py index d6ecc7d6..b0d3164e 100644 --- a/backend/tests/test_auth_endpoints.py +++ b/backend/tests/test_auth_endpoints.py @@ -99,7 +99,8 @@ def test_signup_login_and_me_happy_path(client): "user_id": signup_data["user_id"], "email": "new.user@example.com", } - + + def test_login_short_password_not_rejected_by_schema(client): response = client.post( "/auth/login", @@ -111,6 +112,7 @@ def test_login_short_password_not_rejected_by_schema(client): assert response.status_code != 422 + def test_signup_duplicate_email_returns_409(client): payload = {"email": "dup@example.com", "password": "StrongPass123!"} first_response = client.post("/auth/signup", json=payload)