create a website in which you press login with twitch, you do the login, he gives me back your channel username and if your username is my sub, then you see a content, otherwise not.
Basically a very simple website to create a very simple sub page.
I am using Angular for the website and I just tried to do:
< a href=“https://api.twitch.tv/kraken/oauth2/authorize?response_type=code
&client_id=[CLIENTID]
&redirect_uri=http://localhost:4200
&scope=user_read”>
Click to login with Twitch
It works and it sets the twitch cookie with my username and everything is good.
The problem is that I cannot get this cookie from my website, because this is from twitch.
So how can I do this? Is there a way to get an answer with the username and then make a call to see if he is my sub?
I don’t need to store users. I just want to check if A is sub of me, if it is so, I show a certain page to him, otherwise not.
I don’t want to store anything
If you want to do this without leaking private keys, it is difficult to do it in pure client side code and users would be hesitant to grant access to their subscriptions (since the normal method is to do channel->user rather than user->channel)
Ok so how can I do this? That’s a server but when I usually upload code I just upload the HTML / Angular part without taking care of other if I don’t need to store or something like that.
So how can I do the POST part mentioned in step 3)?
Can I do that from the angular code?
can you help me with it? I am trying but I am not sure I am doing the right thing.
Actually I want to simulate what curl does inside my terminal, but from Angular using Javascript.
I have seen some ways to convert curl into node.js, python and more, but it is not the same, since I am using Typescript.
How would you convert that curl into an HTTP Request via Javascript?
If I do that, I think I’m done