Electron the desktop program can capture the failiure.
Or you get the user to
copy and paste the token from the URL of the broken redirect
Or you throw a page up on GitHub like this
https://barrycarlyon.github.io/twitch_misc/authentication/implicit_auth/
Which’ll return the users oAuth token after implicit auth for the user to copy and paste from GitHub to your program