I'm trying to setup Deezer SDK in my web app. I call DZ.login
in this way:
window.DZ.init({
appId: process.env.DEEZER_APP_ID,
channelUrl: 'http://127.0.0.1:3000/deezer-channel',
player: {
onload: function () {
console.log('dz loaded');
window.DZ.login((res) => {
console.log(res);
});
}
}
});
But then I have I have following error on my redirect page:
Debugging shows that Deezer script on redirect page tries to access DZ object in some other iframe's global object. And it throws this error.
What am I doing wrong?
This question is not related to CORS rules itself. It is related to Deezer SDK OAuth!
It appeared my dev environment ran on localhost:3000
. So redirect page that was opened at 127.0.0.1:3000
treated it as cross-domain resource.