28 lines
563 B
Python
28 lines
563 B
Python
"""Pydantic schemas for auth endpoints."""
|
|
|
|
from pydantic import BaseModel, EmailStr, Field
|
|
|
|
|
|
class RegisterRequest(BaseModel):
|
|
email: EmailStr
|
|
password: str = Field(min_length=8)
|
|
display_name: str = Field(min_length=1, max_length=100)
|
|
|
|
|
|
class LoginRequest(BaseModel):
|
|
email: EmailStr
|
|
password: str
|
|
|
|
|
|
class TokenResponse(BaseModel):
|
|
access_token: str
|
|
token_type: str = "bearer"
|
|
expires_in: int # seconds until expiry
|
|
|
|
|
|
class UserMeResponse(BaseModel):
|
|
id: str
|
|
email: str
|
|
display_name: str
|
|
workspace_id: str | None
|