Skip to content

oauth: retain refresh token when refresh response omits it - #1732

Open
httpsworldview wants to merge 1 commit into
librespot-org:devfrom
httpsworldview:fix/refresh-oauth
Open

oauth: retain refresh token when refresh response omits it#1732
httpsworldview wants to merge 1 commit into
librespot-org:devfrom
httpsworldview:fix/refresh-oauth

Conversation

@httpsworldview

Copy link
Copy Markdown

Spotify may omit refresh_token from successful refresh responses. librespot should reuse the submitted token unless Spotify provides a replacement, preventing consumers from persisting an empty token and possibly requiring re-authentication every few hours.

Signed-off-by: Maika Namuo <httpworldview@gmail.com>
MichaelPachec0 added a commit to MichaelPachec0/ncspot that referenced this pull request Jul 30, 2026
Spotify's token endpoint stopped including a refresh_token in
refresh-grant responses (optional per RFC 6749 §6). librespot-oauth
assumed it was always present and overwrote the stored token with an
empty string, which ncspot then persisted to rspotify_token.json —
breaking every subsequent refresh and forcing interactive browser
re-auth on each token expiry.

Bump the [patch.crates-io] pin from db1ef7a to db65eb1, the head of
librespot-org/librespot#1732, which retains the previous refresh token
when the response omits one. The new rev sits on the dev tip and
includes the previously pinned CDN-fallback fix (hrkfdn#1722), so nothing is
lost. Update flake.nix outputHashes for the new rev accordingly.

Drop the pin once a librespot release containing hrkfdn#1722 and hrkfdn#1732 is
published.

Signed-off-by: Michael Pacheco <git@michaelpacheco.org>
MichaelPachec0 added a commit to MichaelPachec0/ncspot that referenced this pull request Jul 30, 2026
Spotify's token endpoint stopped including a refresh_token in
refresh-grant responses. librespot-oauth
assumed it was always present and overwrote the stored token with an
empty string, which ncspot then persisted to rspotify_token.json —
breaking every subsequent refresh and forcing interactive browser
re-auth on each token expiry.

Bump the [patch.crates-io] pin from db1ef7a to db65eb1, the head of
librespot-org/librespot#1732, which retains the previous refresh token
when the response omits one. The new rev sits on the dev tip and
includes the previously pinned CDN-fallback fix (hrkfdn#1722), so nothing is
lost. Update flake.nix outputHashes for the new rev accordingly.

Drop the pin once a librespot release containing hrkfdn#1722 and hrkfdn#1732 is
published.

Signed-off-by: Michael Pacheco <git@michaelpacheco.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant