فهرست منبع

Call `jwt.decode` with the expected algorithms

Tim Farrell 1 سال پیش
والد
کامیت
4fceb404bd
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      backend/utils/utils.py

+ 1 - 1
backend/utils/utils.py

@@ -48,7 +48,7 @@ def create_token(data: dict, expires_delta: Union[timedelta, None] = None) -> st
 
 
 def decode_token(token: str) -> Optional[dict]:
 def decode_token(token: str) -> Optional[dict]:
     try:
     try:
-        decoded = jwt.decode(token, SESSION_SECRET)
+        decoded = jwt.decode(token, SESSION_SECRET, algorithms=[ALGORITHM])
         return decoded
         return decoded
     except Exception as e:
     except Exception as e:
         return None
         return None