mercredi 13 septembre 2017

unable to get name, and output is undefined

I'm trying to get the user name, but the output is undefined. I still new to javascript on firebase.

    firebase.auth().onAuthStateChanged(function (user) {

        if (user) {

            document.getElementById('welcome').innerHTML = 'Welcome! '+ user.name;
            window.user = user;
            alert( user.email);
            // User is signed in.

        } 




Aucun commentaire:

Enregistrer un commentaire