diff --git a/backend/app/utils.py b/backend/app/utils.py index a3c7e3aee1..f1325e924c 100644 --- a/backend/app/utils.py +++ b/backend/app/utils.py @@ -9,6 +9,7 @@ from jinja2 import Template from jwt.exceptions import InvalidTokenError +from app.core import security from app.core.config import settings @@ -104,14 +105,16 @@ def generate_password_reset_token(email: str) -> str: encoded_jwt = jwt.encode( {"exp": exp, "nbf": now, "sub": email}, settings.SECRET_KEY, - algorithm="HS256", + algorithm=security.ALGORITHM, ) return encoded_jwt def verify_password_reset_token(token: str) -> str | None: try: - decoded_token = jwt.decode(token, settings.SECRET_KEY, algorithms=["HS256"]) + decoded_token = jwt.decode( + token, settings.SECRET_KEY, algorithms=[security.ALGORITHM] + ) return str(decoded_token["sub"]) except InvalidTokenError: return None