I created a sign in function but the display name and the profile doesn’t change
this is based on react-native.
export function createUser(auth, Name, Email, Password) {
if (Name !== "") {
createUserWithEmailAndPassword(auth, Email, Password)
.then((authUser) => {
alert(`Congratulations ${Name}! You are now Whisprer!`);
const user = auth.currentUser;
updateProfile(user, {
displayName : Name,
photoURL : "../assets/user-default.png"
});
})
.catch((error) => {
if (error.code === "auth/email-already-in-use") {
alert("That email address is already in use!");
} else if (error.code === "auth/invalid-email") {
alert("That email address is invalid!");
} else if (error.code === "auth/weak-password") {
alert(
"Weak Password. Password should be at least 6 charcters"
);
} else if (error.code === "auth/missing-password") {
alert("Enter a valid password to continue.");
} else {
alert(error);
}
});
} else {
alert("Enter your valid display name to continue.");
}
}
can you please help me,
thanks in advance
Recognized by Google Cloud Collective
4