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
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...