Nuevo Commit
This commit is contained in:
@@ -24,7 +24,12 @@ def create_access_token(data: dict, expires_delta: Optional[timedelta] = None):
|
||||
|
||||
def decode_access_token(token: str):
|
||||
try:
|
||||
print(f"Attempting to decode token: {token[:50]}...") # Debug
|
||||
print(f"Using SECRET_KEY: {settings.SECRET_KEY[:20]}...") # Debug
|
||||
print(f"Using ALGORITHM: {settings.ALGORITHM}") # Debug
|
||||
payload = jwt.decode(token, settings.SECRET_KEY, algorithms=[settings.ALGORITHM])
|
||||
print(f"Successfully decoded payload: {payload}") # Debug
|
||||
return payload
|
||||
except JWTError:
|
||||
except JWTError as e:
|
||||
print(f"JWT decode error: {e}") # Debug
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user