Skip to content
Snippets Groups Projects
Commit f58333db authored by Yan Grange's avatar Yan Grange :wave:
Browse files

Fix small typo in the client code

parent 6d426c4f
Branches
No related tags found
1 merge request!14Fix small typo in the client code
...@@ -17,7 +17,7 @@ logger = logging.getLogger(__name__) ...@@ -17,7 +17,7 @@ logger = logging.getLogger(__name__)
def is_valid_token(token: str) -> bool: def is_valid_token(token: str) -> bool:
"""Check that the given token has not expired""" """Check that the given token has not expired"""
try: try:
selfdata = token.split(".")[1] data = token.split(".")[1]
padded = data + "=" * divmod(len(data), 4)[1] padded = data + "=" * divmod(len(data), 4)[1]
payload = json.loads(base64.urlsafe_b64decode(padded)) payload = json.loads(base64.urlsafe_b64decode(padded))
return payload["exp"] > int(time.time()) + 10 return payload["exp"] > int(time.time()) + 10
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment