DEV Community

Cover image for Hmm....🚨 OAuth vs Email Signup Conflict β€” Security or Bad UX? (Need your opinion)
Prath
Prath

Posted on

Hmm....🚨 OAuth vs Email Signup Conflict β€” Security or Bad UX? (Need your opinion)

Hello guys,
This is my first post. Apologies if any mistake is there.

So in the morning i came across this git issue on the appwrite git repo #11908.

πŸ§ͺ Scenario
A user signs up using Google OAuth (myemail@google.com)
Then tries to sign up again using email/password (account.create())

πŸ€” Expected Behavior
Appwrite should return:

{
  "message": "A user with the same id, email, or phone already exists in this project.",
  "code": 409,
  "type": "user_already_exists"
}
Enter fullscreen mode Exit fullscreen mode

πŸ˜• Actual Behavior
Instead, it returns:

{
  "message": "There was an error processing your request.",
  "code": 400,
  "type": "general_bad_request"
}
Enter fullscreen mode Exit fullscreen mode

🧠 What's Going On?

In the codebase, this seems intentional:
β€œReturn a generic bad request to prevent exposing existing accounts”
So this is clearly a security decision to avoid account enumeration.

BUT…

βš–οΈ The Inconsistency

If a user signs up normally (email/password) and tries again β†’
Appwrite does return 409 user_already_exists

So:

Case Response
Email β†’ Email again 409 (explicit)
OAuth β†’ Email 400 (generic)

This means:
πŸ‘‰ Enumeration is already possible
πŸ‘‰ But UX is bad only in OAuth cases

πŸ’₯ Why This Matters

For real apps:

Users get confused (β€œDid I already sign up?”)
No clear path to login instead
Poor first impression of auth flow

❓ The Real Question

What should be the correct behavior here?

Option A β€” Security First πŸ”’
Always return generic errors (400)
➑️ Prevents enumeration, but hurts UX

Option B β€” Consistency + UX πŸ‘
Always return 409 user_already_exists
➑️ Better UX, but leaks account existence

Option C β€” Smarter Approach 🧠
Return 409
BUT guide user: β€œTry logging in with Google”
Or auto-link identities
πŸ’¬ I’d Love Your Thoughts
How do you handle this in your apps?
Is account enumeration still a real concern here?
Should OAuth + email accounts be auto-linked?

Let’s discuss πŸ‘‡

Top comments (0)