Skip to content

Commit

Permalink
Fix refresh token key error for login
Browse files Browse the repository at this point in the history
MB doesn't return refresh_token after first auth so use .get instead
to avoid KeyError.
  • Loading branch information
amCap1712 committed Apr 24, 2023
1 parent 8ed7168 commit 88fe1b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion listenbrainz/domain/brainz_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def add_new_user(self, user_id: int, token: dict) -> bool:
user_id=user_id,
service=self.service,
access_token=token["access_token"],
refresh_token=token["refresh_token"],
refresh_token=token.get("refresh_token"),
token_expires_ts=expires_at,
record_listens=False,
scopes=self.scopes
Expand Down

0 comments on commit 88fe1b6

Please sign in to comment.