I came back to a project I was working on last year and now signing up with email does not work. Signing up with google oauth and login works.
This is the error response i get in network tab
{
"message": "There was an error processing your request. Please check the inputs and try again.",
"code": 400,
"type": "general_bad_request",
"version": "0.12.174"
}
This is my config
const client = new Client();
client
.setEndpoint("https://cloud.appwrite.io/v1")
.setProject(import.meta.env.VITE_APPWRITE_PROJECT_ID);
export const authAccount = new Account(client);
export const uniqueId = ID.unique();
export default client;
This is my signup function
export async function createUserAccount(
email: string,
password: string,
name: string
) {
try {
await authAccount.create(uniqueId, email, password, name);
} catch (error: any) {
throw new Error(error);
}
}
This is my submit handler function for the sign up
const signupSubmit = async (e: FormEvent<HTMLFormElement>) => {
e.preventDefault();
const { formData, isFormValid } = getValidFormData(e);
const [nameField, emailField, passwordField, confirmPasswordField] =
formData;
const doesPasswordMatch = passwordField[1] === confirmPasswordField[1];
console.log({ formData });
try {
if (isFormValid && doesPasswordMatch) {
setIsLoading(true);
const account = await createUserAccount(
emailField[1] as string,
passwordField[1] as string,
nameField[1] as string
);
const userAccount = await getUserAccount();
} else {
toastError(
"Cannot submit the form. Please check the highlighted fields for errors and try again."
);
}
} catch (error: any) {
toastError(error.message);
} finally {
setIsLoading(false);
}
};
I always get the error regardless of what inputsit receive and I don't even know what is wrong.
I am making use of v11.0.0 of the appwrite package
Recommended threads
- SSL certificate issuance failed:
Domain verifies but SSL cert fails, tried different subdomains like .api and .aw, used cname and CAA, no prior CAA existed on website, tried Multiple CAAs at on...
- Migration from Self-Hosted to Cloud seem...
Hello, I'm trying to migrate from my Self-Hosted Appwrite instance to Cloud, and can't figure out what's going wrong. - If I initiate the migration from Cloud...
- Deployment fails after 15+ minutes: "Wai...
Hi, I'm Jayden. My email is jaydthom@haverford.org, and i'm having persistent deployment failures with my Next.js project. What happens: Push to GitHub trigg...