Skip to content

Instantly share code, notes, and snippets.

@kobkrit
Created November 16, 2017 04:38
Show Gist options
  • Save kobkrit/6ed60d963c343331e9f76c73d82dcd25 to your computer and use it in GitHub Desktop.
Save kobkrit/6ed60d963c343331e9f76c73d82dcd25 to your computer and use it in GitHub Desktop.
firebase.auth().signInWithCredential(credential)
.then((user) => {
console.log('facebook auth:', user);
this.setState({name: user.email, modalVisible: false});
})
.catch((error) => {
// Handle Errors here.
this.setState({name: 'Anonymous', modalVisible: true});
alert("An error occured: " + error.message);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment