Skip to content

Instantly share code, notes, and snippets.

@pfulop
Created February 7, 2017 19:48
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/c0648bd21fbb24651396eea66facc155 to your computer and use it in GitHub Desktop.
Save pfulop/c0648bd21fbb24651396eea66facc155 to your computer and use it in GitHub Desktop.
export function registerWithEmail(email, password){
return (dispatch,_,firebaseApp)=>{
dispatch({ type: CREATING_ACCOUNT});
firebaseApp.auth().createUserWithEmailAndPassword(email, password)
.then((user) => {
dispatch({ type: CREATED_ACCOUNT, user });
user.sendEmailVerification();
})
.catch(err => dispatch({ type: ERROR, error: err.toString() }));
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment