Fix: Login-Email als str — EmailStr lehnt .local-Domains ab (422 in CI).
All checks were successful
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 9s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s
All checks were successful
Deploy Development / deploy (push) Successful in 35s
Test Suite / pytest-backend (push) Successful in 9s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 13s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
564008be13
commit
25d3976226
|
|
@ -4,13 +4,14 @@ from __future__ import annotations
|
||||||
|
|
||||||
from auth import login, logout, require_auth
|
from auth import login, logout, require_auth
|
||||||
from fastapi import APIRouter, Depends, Response
|
from fastapi import APIRouter, Depends, Response
|
||||||
from pydantic import BaseModel, EmailStr, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
router = APIRouter(prefix="/api/auth", tags=["auth"])
|
router = APIRouter(prefix="/api/auth", tags=["auth"])
|
||||||
|
|
||||||
|
|
||||||
class LoginRequest(BaseModel):
|
class LoginRequest(BaseModel):
|
||||||
email: EmailStr
|
# str statt EmailStr: Self-Hosted/Dev nutzt oft .local-Domains (admin@kairo.local)
|
||||||
|
email: str = Field(min_length=3, max_length=255)
|
||||||
password: str = Field(min_length=8, max_length=256)
|
password: str = Field(min_length=8, max_length=256)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ def create_user(
|
||||||
display_name: str = "Test User",
|
display_name: str = "Test User",
|
||||||
portal_role: str = "user",
|
portal_role: str = "user",
|
||||||
) -> dict:
|
) -> dict:
|
||||||
email = email or f"user-{uuid.uuid4().hex[:8]}@test.local"
|
email = email or f"user-{uuid.uuid4().hex[:8]}@example.com"
|
||||||
conn = get_connection()
|
conn = get_connection()
|
||||||
try:
|
try:
|
||||||
with conn.cursor() as cur:
|
with conn.cursor() as cur:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user