Let register return access token without extra login

This commit is contained in:
lvrossem
2023-03-31 07:43:10 -06:00
parent 032a6ed543
commit edd50b9ecb
2 changed files with 8 additions and 8 deletions

View File

@@ -66,14 +66,14 @@ async def patch_current_user(
crud_users.patch_user(db, current_user_name, user)
@app.post("/register", response_model=users.User)
@app.post("/register")
async def register(user: users.UserCreate, db: Session = Depends(get_db)):
return crud_authentication.register(db, user.username, user.password)
@app.post("/login")
async def login(user: users.UserCreate, db: Session = Depends(get_db)):
return crud_authentication.login(db, user)
return crud_authentication.login(db, user.username, user.password)
@app.get("/highscores", response_model=List[users.UserHighScore])