Code = from the URL

Users comes to your site
User clicks login butt
User goes to twitch
User comes back to your site
You use the code, you redirect the user to your site.

Like this PHP example

You can see that if a ?code exists it’s processed, after after processing the user is redirect to / and they never even see the ?code