I am working on an application that will have twitch login.
I am able to get everything working.
However, we have multiple environments - localhost, test.website.com and website.com.
I use localhost for development, test.website.com for testing and website.com is our product.
The issue I am facing is that Twitch allows only one redirect_uri. How do I handle that I want the same user to be able to login into localhost, test.website and website without changing the redirect_uri.
As of now, I end up changing the redirec_uri whenever I am doing dev work or testing.
One option I considered is to have three different twitch applications, but that means I will have to sign up using twitch for every test user on each of the three platforms and I do not like that solution.
How do you store the information gathered? Are all tables contained within the same database? Could they be?
Perhaps some database magic would solve this for you by consolidating your login credentials and just using the one uri to populate the, letās say, three tables in the db that require the information⦠This assumes that your database is āremoteā from the three domain containers.
Itās really stabbing in the dark until we know how you handle the information on the backend.
The alternative to registering multiple applications is to use a single redirect URI, which will then forward you to the desired domain using the state parameter.
Generally speaking in the world of development you would have separate Keys/Configs for dev, testing and production.
What @3ventic suggests is sound, but it means you leave in code in production that could err and send a user to the wrong domain and half the time the code is sat there slowing your website down as it does nothing but interrogate the state parameter for āwhere should I send this guyā when the redirect URI and Application Keys already decided this for you.
So three applications is the way to go in my opinion