Skip to content

Commit

Permalink
Update helpers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Mar 23, 2023
1 parent 4ae0a21 commit e1ba5e2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gotrue/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def decode_jwt_payload(token: str) -> Any:
parts = token.split(".")
if len(parts) != 3:
raise ValueError("JWT is not valid: not a JWT structure")
base64Url = parts[1]
# Addding padding otherwise the following error happens:
# binascii.Error: Incorrect padding
base64UrlWithPadding = base64Url + '=' * (-len(base64Url) % 4)
Expand Down

0 comments on commit e1ba5e2

Please sign in to comment.