Wednesday, 10 May 2017

Where to put on success code in node JS for firebase

I want to do authentication with firebase. When I want to sign up a user I use the followin code

    firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
  // Handle Errors here.
  var errorCode = error.code;
  var errorMessage = error.message;
  res.render('signup', { errorMessage: errorMessage });
});

When they succeed to signup, I want to redirect them to the login page but I don't know where to put this code because it's asynchronous.



via tomzinho

No comments:

Post a Comment