Everyone goes to “redirect_url” on the “redirect_url” page the user is shown logged out content, they click the link, which then goes to Twitch, they login and authorise the app, and are sent back to the “redirect_url” page with the code.
If there is a code you verify the code and if you get a user packet as in my code, then you are logged in…
It’s a simple if statement…
If $gotUserName then logged in, and thus show logged in content. else show the login button and/or an error message