I have been trying to solve this issue in my extension for a few days.
My onAuthorized callback has been working fine in local test using the native dev rig. However when I moved to Hosted Test, I am no longer receiving access to the viewer’s id. I feel like I must be doing some wrong, but can’t figure out what.
When my onAuthorized callback runs, my JS will console.log the viewer’s id (my extension has “Request Identity Link” set to Yes. and if i detect that Twitch.ext.viewer.id is null, then i show an “Authorize” button to perform a requestIdShare).
When locally testing in the rig, with a view for Logged In User, Identity Linked, it fires onAuthorized automatically, i grab their JWT, pass it up to my EBS and fetch their displayname via Twitch API, etc, and everything is great.
When doing a Hosted Test on my channel (note: i have a second account, whitelisted for testing, as the Viewer), I see that onAuthorized does not fire automatically. Then I click my Authorize button and use the RequestIdShare dialog to grant access. But it still doesnt fire onAuthorized. I also added a button to simply console.log(window.Twitch.ext.viewer.id) when i click it, and it’s always null, even after Granting access to my id.
Does it sound like I’m missing something?
There are no errors in my browser console.