class Auth extends React.Component {
    constructor() {
        super()
        this.state = {}
    }

    componentWillMount()
    {
        this.setState({user : JSON.parse(localStorage.getItem('amazingpixel::user'))}) 
    }
    
    login()
    {
        var react = this
        var provider = new firebase.auth.GoogleAuthProvider();
        firebase.auth().signInWithPopup(provider).then(function(result) {
            var user = result.user
            console.log(user)
            react.setState(
                {
                    user: {
                        uid: user.uid,
                        displayName: user.displayName
                    }
                }
            )

            localStorage.setItem('amazingpixel::user', JSON.stringify(react.state.user))
            
            var firebaseRef = new Firebase('https://reactresume.firebaseio.com/')
            var userRef = firebaseRef.child(react.state.user.uid)
            userRef.set(react.state.user)
        }).catch(function(error) {
            console.log(error)
        });
    }

    logout()
    {
        var react = this
        if (react.state.user){
            var react = this
            firebase.auth().signOut().then(function() {
                localStorage.removeItem('amazingpixel::user')
                react.setState({user:null})
            }, function(error) {
                console.log(error)
            });
        }
    }
    
    render() {
            if (this.state.user == null) {
                return (
                    <ul id="nav-mobile" className="right">
                        <li><a href="#" onClick={this.login.bind(this)}>Login Via Google</a></li>
                    </ul>
                );
            } else  {
                return (
                    <ul id="nav-mobile" className="right">
                        <li>{this.state.user.displayName}</li>
                        <li><a href="#" onClick={this.logout.bind(this)}>Logout</a></li>
                    </ul>
                );
            }
        }
}

MyComponents.Auth = Auth

@@ -333,16 +333,52 @@
 ider();%0A
+        provider.addScope('email');%0A
         
@@ -477,16 +477,64 @@
 ult.user
+.providerData%5B0%5D%0A            console.log(result)
 %0A       
@@ -697,37 +697,127 @@
     
-displayName: user.displayName
+email: user.email,%0A                        displayName: user.displayName,%0A                        avatar: user.photoURL
 %0A   
@@ -1096,16 +1096,31 @@
 f.child(
+'users').child(
 react.st

modify auth component, added email, avatar info, use another version of uid