Update main.py
Browse files
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 |
-
|
280 |
-
|
|
|
|
|
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")
|