Validation_Suite/validation-suite/backend/mercury/app/schemas/auth.py
2026-07-11 15:50:15 +02:00

37 lines
759 B
Python

from __future__ import annotations
from datetime import datetime
from pydantic import BaseModel, EmailStr
from app.models.user import UserRole
from app.schemas.common import EntityRead
class LoginRequest(BaseModel):
email: EmailStr
password: str
class TokenResponse(BaseModel):
access_token: str
token_type: str = "bearer"
expires_in: int
user: UserRead
class UserRead(EntityRead):
email: EmailStr
first_name: str
last_name: str
role: UserRole
is_active: bool
must_change_password: bool
last_login_at: datetime | None = None
password_changed_at: datetime | None = None
class ChangePasswordRequest(BaseModel):
current_password: str
new_password: str
new_password_confirmation: str