Skip to content

Instantly share code, notes, and snippets.

@pfulop
Created February 8, 2017 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfulop/377c464a7397e066d9341b53189670b4 to your computer and use it in GitHub Desktop.
Save pfulop/377c464a7397e066d9341b53189670b4 to your computer and use it in GitHub Desktop.
export function loginWithFacebook(accessToken){
return (dispatch,_,firebaseApp)=>{
dispatch({ type: LOGGING_IN});
const credential = firebase.auth.FacebookAuthProvider.credential(accessToken);
firebaseApp.auth().signInWithCredential(credential).then((user) => {
dispatch({ type: LOGGED_IN, user });
}).catch((error) => {
console.log(error);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment