How to get the user id of the newly created user in firebase

This project is done using angular, I want to get the user id of the newly created user and set it to a variable so i can use it to identify the particular user using that id.

The Code:

submit()
  {
   this.Auth.createUserWithEmailAndPassword(this.form.Eemail, this.password).then( res => {
   this.user.addnotice(this.form);
   this.cancel();
   this.succesToast();
   }, err =>{
     this.failToast();
   })
  }

The above code creates the user but i want to get the id of the created user so how do i do that.

25 thoughts on “How to get the user id of the newly created user in firebase”

Leave a Comment