Rank 1: Thread
I keep getting the error A user with the same id, email, or phone already exists in this project., I have tried looking through previous posts and docs. None of which seems to help resolve the issue. I am selfhosting, and if i create an account from the dashboard it is fine. My code is below.
import { SafeAreaView, TouchableOpacity } from "react-native";import { Card, Text, TextInput } from "react-native-paper";import {Account, Client, ID } from "appwrite";import PropTypes from "prop-types";import { validateName, validateEmail, validatePassword } from "../../utils/validators";
import AuthLogo from "../../components/AuthLogo";import AppStyle from "../../styling/AppStyling";import AuthStyle from "../../styling/AuthStyling";
SignUpScreen.propTypes = { navigation: PropTypes.shape({ navigate: PropTypes.func.isRequired, }).isRequired,};
export default function SignUpScreen({ navigation }) { const [firstName, setFirstName] = useState(""); const [lastName, setLastName] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [confirmPassword, setConfirmPassword] = useState("");
const client = new Client();
client .setEndpoint("Omitted") .setProject("Omitted");
const handleSignUp = async () => {
const account = new Account(client);
const promise = await account.create(ID.unique(), email, password, `${firstName} ${lastName}`);
promise.then(function () { navigation.navigate("Login"); }, function (error) { console.log(error); // Failure }); };```