Currently, I'm using the email as the document name but I'd like to use the UID instead. I tried using "firebase.auth().currentUser.uid" but that retrieves the UID from the last user.
try {
setError("");
setLoading(true);
await signup(emailRef.current.value, passwordRef.current.value);
await db
.collection("users")
.doc(emailRef)
.set(
{
firstName: firstNameRef.current.value,
lastName: lastNameRef.current.value,
},
{ merge: true }
)