Created
February 8, 2017 20:07
-
-
Save pfulop/377c464a7397e066d9341b53189670b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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