Skip to content

Commit

Permalink
Discord user id from token fix
Browse files Browse the repository at this point in the history
  • Loading branch information
the-laziest-coder committed Feb 7, 2024
1 parent 923d554 commit ebbaeb1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/galxe/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,9 @@ async def link_discord(self):
def _get_discord_user_id(self):
if self.account.discord_token == '':
raise Exception('Empty Discord token')
return str(base64.b64decode(self.account.discord_token.split('.')[0].encode("utf-8")), 'utf-8')
token = self.account.discord_token.split('.')[0]
token += '=' * (4 - len(token) % 4)
return str(base64.b64decode(token.encode("utf-8")), 'utf-8')

@classmethod
def _extract_code_from_email(cls, text):
Expand Down

0 comments on commit ebbaeb1

Please sign in to comment.