Currently, I am working on implementing the Firebase createUserWithEmailAndPassword method. However, I would like to include an additional field named 'name' in Cloud Firestore. Below is a snippet of my code:
auth.service.ts
SignUp(email: string, password: string) {
return this.afAuth.createUserWithEmailAndPassword(email, password)
.then((result) => {
/* Call the SendVerificationMail() function when new user sign
up and returns promise */
// this.SendVerificationMail();
this.SetUserData(result.user);
}).catch((error) => {
window.alert(error.message)
})
}
signup.component.html
<div class="formGroup">
<input type="email" class="formControl" placeholder="Email Address" id="userEmail" required>
</div>
<div class="formGroup">
<input type="password" class="formControl" placeholder="Password" id="userPwd" required>
</div>
<div class="formGroup">
<input type="button" class="btn btnPrimary" value="Sign Up"
(click)="authService.SignUp(userEmail.value, userPwd.value)">
</div>
Does anyone have suggestions on how I can achieve this?