feature/passwordForgot #49

Merged
v4l3n71n merged 3 commits from feature/passwordForgot into master 2025-02-14 20:06:45 +00:00
2 changed files with 2 additions and 3 deletions
Showing only changes of commit 9ab9058927 - Show all commits

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: