Your redirecturi is not URL encoded.
So your twitch login links reads:
- Goto
https://id.twitch.tv/oauth2/authorize - With
client_id=clientid - With Redirect URI
redirect_uri="+redirecturi+"&response_type=code&scope="+scope+"&force_verify=true"
You need to URIEncode the Redirect URI.
This looks like JS so the “fix” is
var url = "https://id.twitch.tv/oauth2/authorize?client_id="+clientid+"&redirect_uri="+encodeURIComponent(redirecturi)+"&response_type=code&scope="+scope+"&force_verify=true";
as per this exmaple
document.getElementById('authorize_public').setAttribute('href', 'https://id.twitch.tv/oauth2/authorize?client_id=' + client_id + '&redirect_uri=' + encodeURIComponent(redirect) + '&response_type=token');
https://barrycarlyon.github.io/twitch_misc/authentication/implicit_auth/