Broken twitch embed user login

I have embed the twitch channel player in my page.
When the unauthenticated user tries to chat, it is prompted with the login modal.

After inserting credentials, the following error is displayed on the javascript console and the chat area goes black.

Refused to display ‘https://www.twitch.tv/passport-callback#access_token=mmw50i9ii7j44jgib42n9owl7ath40&scope=chat_login+user_read+user_subscriptions+user_presence_friends_read&state={“next”%3A"https%3A%2F%2Fwww.twitch.tv%2Fembed%2Fsolary%2Fchat%3Fte-theme%3Dlight%26origin%3Dhttps%3A%2F%2Fembed.twitch.tv"%2C"nonce"%3A"2b6cfd17648ce383ccc6e089330722d9"}’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’.

ALSO, the event Twitch.Embed.AUTHENTICATE never gets fired.

embed.addEventListener(Twitch.Embed.AUTHENTICATE, function(user) {
  console.log(user.login + ' just logged in');
});

I am using this script:

<script src="https://embed.twitch.tv/embed/v1.js"></script>

I find the documentation confusing and broken. At times it mixes things that exist on the script at https://embed.twitch.tv/embed/v1.js, other times from an older script at http://player.twitch.tv/js/embed/v1.js.
This is very frustrating and I wast time having to figure out what works and what doesn’t.

BTW, the documentation for the player api regarding layout says that the default option is ‘video-and-chat’, but after inspection upon the javascript, it should have been ‘video-with-chat’.


This is the script I am talking about: https://embed.twitch.tv/assets/js/twitch-everywhere.051039a7da675b4efd93.js

The documentation is a mess honestly :face_with_head_bandage:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.