Skip to content

Commit

Permalink
fix: use the newly acquired access token during token refresh
Browse files Browse the repository at this point in the history
previously, after a refresh, we would have to attempt another call
  • Loading branch information
David Ly committed Sep 1, 2023
1 parent ef39a0e commit 28028db
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ interface SpotifyApi {
clientId = clientId,
clientSecret = clientSecret,
)

val accessToken = newAccessToken.accessToken
spotifyAuthState.saveAccessToken(
accessToken = newAccessToken.accessToken,
accessToken = accessToken,
)

val accessToken = spotifyAuthState.getAccessToken() ?: return@refreshTokens null
BearerTokens(accessToken, "")
}
sendWithoutRequest { true }
Expand Down

0 comments on commit 28028db

Please sign in to comment.