master user anlegen #2
|
|
@ -4,13 +4,14 @@ from __future__ import annotations
|
|||
|
||||
from auth import login, logout, require_auth
|
||||
from fastapi import APIRouter, Depends, Response
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
router = APIRouter(prefix="/api/auth", tags=["auth"])
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ def create_user(
|
|||
display_name: str = "Test User",
|
||||
portal_role: str = "user",
|
||||
) -> 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()
|
||||
try:
|
||||
with conn.cursor() as cur:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user