[RESOLVED] 400 Invalid authorization code

It won’t to your issue it’s just a problem/bad practice I pointed out, on the outbound link. (Sorry should of been more clear)

I believe your code is doing the token exchange Twitch.

oAuth flow is: for “normal oAuth flows”

  1. Redirect/Send the user to Twitch
  2. They either Accept or Decline at Twitch
  3. If they accept they are sent to your callback URL with the code in the query string
  4. You exchange the code for a token.

The most common reason for

Is you

This might occur if you return to your website, do the code for token exchange, then redirect from that page to another page with the code still in the query string and then your code for token exchange login fires again (I’ve done that before myself)