Im getting an 401 invalid token when i'm trying to get a top artists.
this is my code, i'm not sure if thats the best way to do it tho:
get authorization:
get code:
get the top artists:
thats my first time using the library (and react) so I might have done something wrong and I'm not seeing it
Edit: I figured that I'm suppose to make a call for the /api/token endpoint first but my fetch is doing the same request twice (one returns status 200 with the token and the other returns 400 authentication invalid and overwrites the first one) is that normal?
Im getting an 401 invalid token when i'm trying to get a top artists.
this is my code, i'm not sure if thats the best way to do it tho: get authorization:
get code:
get the top artists:
thats my first time using the library (and react) so I might have done something wrong and I'm not seeing it
Edit: I figured that I'm suppose to make a call for the /api/token endpoint first but my fetch is doing the same request twice (one returns status 200 with the token and the other returns 400 authentication invalid and overwrites the first one) is that normal?