Skip to content
Back

Document with the requested ID already exists. Try again with a different ID or use ID.unique() to g

  • 0
  • Auth
  • Web
mcjo3324
18 Nov, 2024, 15:49

Hello,

I have this error when i'm trying to log.

I'm using :

  • SDK client
  • Email login (OTP)
  • Vue 3, web

The mail i used is not register in my AW console so it will be created but i have this 409 error.

Solution already done : create a route in my back to have users list and return an unique ID or userId but same error.

My code :

TypeScript
 const client = new Client()
      .setEndpoint(import.meta.env.VITE_API_APPWRITE_FUNCTION_API_ENDPOINT)
      .setProject(import.meta.env.VITE_API_APPWRITE_PROJECT_ID_KEY);

    const account = new Account(client);

    return await account.createEmailToken(
        ID.unique(),
        email
    );
TL;DR
Issue: Error message "Document with the requested ID already exists" encountered when trying to log in using SDK client, Email login (OTP), and Vue 3 web. The email used is not registered in the AW console, resulting in a 409 error even after creating a route in the backend to generate a unique ID. Solution: Change the ID generation method to use `ID.unique()`.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more