zembrodt / showtunes

Angular App to display music you are currently listening to
GNU General Public License v3.0
3 stars 0 forks source link

Use token expiry to calculate when to request new auth token #52

Closed zembrodt closed 3 months ago

zembrodt commented 1 year ago

The auth token expiry value given by Spotify OAuth is currently not being used. A token is refreshed when a request is sent to Spotify and denied due to it being an expired token.

An interceptor should be created to check if the token is expired, or within some expiry threshold, to then request a new auth token from Spotify, and continue the initial request with the new auth token in the headers.