justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 381 forks source link

Authenticate user when they login from chat iframe #612

Closed BrittMcDanel closed 7 years ago

BrittMcDanel commented 7 years ago

I am using the chat iframe and would like to be able to authenticate users from their logging in to the chat. Currently, I authenticate using the procedure here:

https://github.com/justintv/twitch-js-sdk

where the login is done via:

$('.twitch-connect').click(function() {
      Twitch.login({
        redirect_uri: REDIRECT_URI,
        scope: ['user_read', 'channel_read']
      });
})

Is there a way to do this when the user logs in to the chat as well? It seems silly to log in via chat and then have to log in by clicking the button as well.

Thanks