25 lines
515 B
Python
25 lines
515 B
Python
|
"""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
|