Nuevos cambios en el backend

This commit is contained in:
Mireya Cueto Garrido
2026-05-19 10:21:34 +02:00
parent 02da44fb30
commit ba2507918b
20 changed files with 494 additions and 55 deletions
+35
View File
@@ -0,0 +1,35 @@
import uuid
from datetime import datetime
from pydantic import BaseModel, ConfigDict, EmailStr, Field
class UserRegister(BaseModel):
email: EmailStr
password: str = Field(min_length=8, max_length=128)
full_name: str | None = Field(default=None, max_length=200)
class UserLogin(BaseModel):
email: EmailStr
password: str = Field(min_length=1, max_length=128)
class UserRead(BaseModel):
id: uuid.UUID
email: EmailStr
full_name: str | None
created_at: datetime
model_config = ConfigDict(from_attributes=True)
class GoogleLoginRequest(BaseModel):
"""ID token obtenido en el frontend con Google Identity Services (Sign in with Google)."""
id_token: str = Field(min_length=10, max_length=8_000)
class TokenResponse(BaseModel):
access_token: str
token_type: str = "bearer"