fastapi-svelte-template/backend/todo/schemas/auth.py

25 lines
515 B
Python
Raw Normal View History

2023-05-31 16:37:56 +01:00
"""This module declareds the pydantic ORM representation for authentication responses."""
from pydantic import BaseModel
from todo.schemas.users import User
class UserWithPassword(User):
"""Schema used during authentication.
As this object includes the user's hashed password, it should NEVER be sent
to the client.
"""
password: str
class Config:
orm_mode = True
class AuthResponseToken(BaseModel):
"""Schema used when responding to a login request."""
token: str