score:0

Accepted answer
try {
  setError("");
  setLoading(true);
  await signup(emailRef.current.value, passwordRef.current.value);

  // 👇
  await database.student.add({
    firstName: firstName,
    lastName: lastName,
    userId: currentUser.uid,
    createdAt: database.getCurrentTimestamp(),
  })

  navigate("/dashboard");
} catch {
  setError("Failed to create an account");
}

Related Query

More Query from same tag