Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase first login or signup events

I am using firebase authentication in my app. I want to redirectUser to a particular page if the user signs in for the first time or just signs up. Can somebody please tell me how to do this?

like image 609
Climb Tree Avatar asked Sep 09 '25 15:09

Climb Tree


1 Answers

I you are using a identity provider, such as Google Sign-In or Facebook Login the only way to do that is to store an atributte where you kept the information needed to check if is the first login or not.

If you're using a password based account you can call the function to redirect after creating the user.

firebase.auth()
  .createUserWithEmailAndPassword(email, password)
  .then(() => { 
    //MyFunction
  }).catch((error) => { 
    //Handle the error
  });
like image 194
Joseba Avatar answered Sep 14 '25 12:09

Joseba



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!