Unable to generate OAuth token from Spotify API for the Jammming project

I am trying to get an OAuth token to modify the current user’s playlist. It’s for the jammming project. When I test it, here’s what happens:

  1. The Spotify login page comes up, as expected
  2. I click agree in hopes of getting the token
  3. The login page refreshes.
  4. It does not redirect to the redirect URI; it just stays on the login page.

I have checked the console, but it shows no errors. I am working with React
Here’s the code:

I have a few theories. One of them is that the URL parameter at the fetch request toward the end should be some sort of token access endpoint from Spotify. But I read the documentation and can’t seem to find any such URL.

1 Like