tranny / App /Users /Schemas.py
Mbonea's picture
jwt works the routes are secured!
591d823
raw
history blame
496 Bytes
from typing import List, Optional
from pydantic import EmailStr, BaseModel
from passlib.context import CryptContext
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
class UserSchema(BaseModel):
pk: int
id: int
name: str
class Config:
orm_mode = True
class BaseRequest(BaseModel):
email: EmailStr
name: str
password: str
phoneNumber: Optional[str]
def hash_password(self):
self.password = pwd_context.hash(self.password)