Because it seems you are not redirecting the user to Twitch.
You seem to be using a lib to fetch the URL instead of redirecting.
It may also be a bug with passport since you are using passport
here is a “more simple” example
You have a / missing as the redirect URL is invalid a missing / between 3000 and auth
This section is also wrong.
You’ve got a load of weirdness going on here. And I don’t know if the issue is with PassportJS or something you have done.
For User oAuth authentication
- Generate a URL with scopes/etc as needed using
response_type=code - Display that URL to the user in the web browser or redirect them to that URL
- They will accept/decline the authorisation
- They come back with a
codeexchange thecodefor an access token/refresh token key pair
You don’t need the kraken v5 header with helix