Gregniuki commited on
Commit
a3e50a2
1 Parent(s): 576d38f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -2
main.py CHANGED
@@ -276,8 +276,10 @@ async def password_reset_request(email: str = Form(...), db: Session = Depends(g
276
  async def password_reset_form(request: Request):
277
  return templates.TemplateResponse("password_reset_request.html", {"request": request})
278
 
279
- @app.get("/reset-password")
280
- async def reset_password(token: str, new_password: str, db: Session = Depends(get_db)):
 
 
281
  user = get_user_by_verification_token(db, token)
282
  if not user:
283
  raise HTTPException(status_code=400, detail="Invalid or expired token")
 
276
  async def password_reset_form(request: Request):
277
  return templates.TemplateResponse("password_reset_request.html", {"request": request})
278
 
279
+ from fastapi import Form
280
+
281
+ @app.post("/reset-password")
282
+ async def reset_password(token: str = Form(...), new_password: str = Form(...), db: Session = Depends(get_db)):
283
  user = get_user_by_verification_token(db, token)
284
  if not user:
285
  raise HTTPException(status_code=400, detail="Invalid or expired token")