React app oidc-client IE11 problem when calling signInCallback()

Viewed 217

I've been building this react app for a couple of months now and everything was fine. I'm using oidc-client and it works like a charm with the other browsers but when it comes to IE11 there is a problem. I'm calling the function from a js bundle into a static html which is located in a public folder.

window.onload = function() { 
  signInCallback();
};

the config in the callbacks.js is:

    const signInCallback = () => {
    new UserManager({ response_mode: "query" })
        .signinRedirectCallback()
        .then((user) => {
            if (user) {
                window.location = user.state.redirectUrl;
            } else {
                GetBaseUrl().then((url) => { window.location = url; });
            }
        }).catch((e) => {
            console.error(e);
        });
};

This is the result in IE11: image

The first issue I tried solving is window.onload doesn't seem to work in IE. So i changed the code in the html file to this (of course I added the CDN for the oidc-client in the html) and again it was working fine with the other browsers:

 new Oidc.UserManager({ response_mode: "query" })
    .signinRedirectCallback()
    .then(function(user) {
        if (user) {
            window.location = user.state.redirectUrl;
        } else {
            GetBaseUrl().then(function(url) { window.location = url; });
        }
    }).catch(function(e) {
        console.error(e);
    });

but the result was:

image

I tried a couple of more things, like setting a setTimeout and adding polyfils.

0 Answers
Related