correction de la fonction login

main
Anaz 2025-01-28 13:53:32 +04:00
parent bc28025058
commit 28e992cceb
1 changed files with 2 additions and 2 deletions

View File

@ -31,8 +31,8 @@ async def signup(user: UserCreate, db=Depends(get_db)):
return await UserService.create_user(user, db)
@router.post("/token", response_model=Token, summary="Login and get access token")
async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends(), db=Depends(get_db)):
user = await AuthService.authenticate_user(form_data.username, form_data.password, db)
async def login_for_access_token(username: str, password: str, db=Depends(get_db)):
user = await AuthService.authenticate_user(username, password, db)
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,