Start foundations

This commit is contained in:
François Voron
2019-10-05 17:39:37 +02:00
commit 4e0b0f6f7d
10 changed files with 541 additions and 0 deletions

12
fastapi_users/router.py Normal file
View File

@ -0,0 +1,12 @@
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)