Back

Incorrect 400 Error When Creating Account With Existing OAuth Email

  • 0
  • Self Hosted
  • Auth
  • Flutter
Egor Tabula
28 Mar, 2025, 14:02

πŸ‘‹ Hello! I’m encountering an unexpected behavior when creating a user in Appwrite.

πŸ” Issue: β€’ I first created a user using Google OAuth. β€’ Then I tried to create a user with the same email using email/password. β€’ Instead of receiving the expected 409 user_already_exists error, I received: AppwriteException: general_bad_request There was an error processing your request. Please check the inputs and try again. (400)

However:

βœ… If I first create a regular email/password account and then try to create another email/password account with the same email, I correctly receive a 409 user_already_exists error.

❓ Question:

Why am I getting a 400 Bad Request instead of a 409 user_already_exists when the email is already registered via OAuth?

Is this expected behavior or a bug?

βš™οΈ Environment: β€’ Appwrite: 1.6.1 (self-hosted) β€’ SDK: Flutter 15.0.0

Thanks in advance for your help! πŸ™Œ

TL;DR
Issue: Creating a user with an existing OAuth email in Appwrite results in a 400 Bad Request error instead of the expected 409 user_already_exists error. Correct behavior occurs for regular email/password accounts. Solution: This behavior is unintended and is likely a bug. You should receive a 409 error when trying to create an account with an OAuth email that already exists.
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