허재영
허재영

Reputation: 1

Why doesn't firebase javascript authentication work with ie11?

I have implemented google authentication on a web page using firebase sdk.

It works fine on chrome, firefox and edge, but on ie11 I get a google authentication page but the authenticated user information is always null.

I think it's supported in ie 11. firebase.google.com/support/guides/environments_js-sdk

I added the polyfill by cdn and executed it but it doesn't work. User information is still null. unpkg.com/[email protected]/minified.js

Why doesn't it only work with ie11?

*function signInGoogle() {
    if (!firebase.auth().currentUser) {
        var provider = new firebase.auth.GoogleAuthProvider();
        provider.addScope('https://www.googleapis.com/auth/plus.login');
        firebase.auth().signInWithRedirect(provider);
    } else {
        firebase.auth().signOut();
    }
}

function initApp() {
    firebase.auth().getRedirectResult().then(function (result) {
        var user = result.user;
        console.log(user);   // always null 
        if (user) {
            document.getElementById('createForm').submit();
        }
    }).catch(function (error) {
        var errorCode = error.code;
        var errorMessage = error.message;
        var email = error.email;
        var credential = error.credential;
        // [START_EXCLUDE]
        if (errorCode === 'auth/account-exists-with-different-credential') {
            alert('You have already signed up with a different auth provider for that email.');
        } else {
            console.error(error);
        }
    });

}*

Upvotes: 0

Views: 520

Answers (1)

sylvann
sylvann

Reputation: 142

In order to reduce the SDK size, Firebase no longer ship the Polyfils that are required for some older browsers. This was one of the changes in the 6.x release.

Please take a look at https://firebase.google.com/support/guides/environments_js-sdk how to manually enable Polyfills as required.

Upvotes: 1

Related Questions