🔒️ Refactor migrate from python-jose to PyJWT (#1203)
This commit is contained in:
@@ -5,8 +5,9 @@ from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import emails # type: ignore
|
||||
import jwt
|
||||
from jinja2 import Template
|
||||
from jose import JWTError, jwt
|
||||
from jwt.exceptions import InvalidTokenError
|
||||
|
||||
from app.core.config import settings
|
||||
|
||||
@@ -112,5 +113,5 @@ def verify_password_reset_token(token: str) -> str | None:
|
||||
try:
|
||||
decoded_token = jwt.decode(token, settings.SECRET_KEY, algorithms=["HS256"])
|
||||
return str(decoded_token["sub"])
|
||||
except JWTError:
|
||||
except InvalidTokenError:
|
||||
return None
|
||||
|
Reference in New Issue
Block a user