fix password

This commit is contained in:
Valentin CZERYBA 2025-02-13 20:41:16 +01:00
parent 672eeea110
commit 9ab9058927
2 changed files with 2 additions and 3 deletions

View File

@ -1,7 +1,7 @@
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from .routers import users, token, mail, events, tags
from .routers import users, token, mail, events, tags, password
from .dependencies import user_add
import os

View File

@ -81,8 +81,7 @@ async def reset_password(request: Request, key: str | None = None, email: str |
return templates.TemplateResponse("reset_password.html", {"request": request, "email": email, "key": key})
@router.post("/password/update", tags=["password"])
async def update_password(email: str = Form(...), key: str = Form(...), new_password: str = Form(...), request: Request):
# Vérification du token dans Redis
async def update_password(request: Request, email: str = Form(...), key: str = Form(...), new_password: str = Form(...)): # Vérification du token dans Redis
key_hashed = database.connect_redis.get(email)
if key_hashed is None or key_hashed.decode() != key: