aboutsummaryrefslogtreecommitdiff
path: root/app/routes
diff options
context:
space:
mode:
Diffstat (limited to 'app/routes')
-rw-r--r--app/routes/user_routes.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/routes/user_routes.py b/app/routes/user_routes.py
index c356104..7fcc768 100644
--- a/app/routes/user_routes.py
+++ b/app/routes/user_routes.py
@@ -1,5 +1,6 @@
from fastapi import APIRouter, status, Path, Depends
from fastapi.exception_handlers import HTTPException
+from fastapi.security import OAuth2PasswordRequestForm
from typing import Annotated
import string
import bcrypt
@@ -92,15 +93,15 @@ async def update_pass(
@router.post("/register", summary="Register a new user")
async def get_links(
- login_data: LoginDataSchema,
+ form_data: Annotated[OAuth2PasswordRequestForm, Depends()],
db=Depends(get_db),
):
"""
Given the login data (username, password) process the registration of a new
user account and return either the user or an error message
"""
- username = login_data.username
- password = login_data.password
+ username = form_data.username
+ password = form_data.password
# Make sure the password meets all of the requirements
check_password_reqs(password)