Files
François Voron 4e0b0f6f7d Start foundations
2019-10-05 17:39:37 +02:00

13 lines
319 B
Python

from fastapi import APIRouter
from .models import UserCreate, UserDB
from .password import get_password_hash
router = APIRouter()
@router.post('/register')
async def register(user: UserCreate):
hashed_password = get_password_hash(user.password)
return UserDB(**user.dict(), hashed_password=hashed_password)