fix(signup): reject an email that already has an account #37

Merged
sharang merged 1 commits from fix/signup-email-taken into main 2026-09-23 22:09:01 +00:00
Owner

Found on staging: signup sharna with an address that already had an account in the stage realm. The log showed keycloak provision failed: user already exists, the tenant and organization existed without an admin, and the portal said "check your inbox".

  • New Adapter.UserExists(email) (HTTP + mock).
  • POST /v1/tenants checks it before creating anything and returns 409 email_taken. If the lookup itself fails, it falls through to the existing best-effort path.
  • Tests: server (eachStore), HTTP adapter (found / missing / lookup error), mock.

The portal shows a German message for email_taken in a separate PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB

Found on staging: signup `sharna` with an address that already had an account in the stage realm. The log showed `keycloak provision failed: user already exists`, the tenant and organization existed without an admin, and the portal said "check your inbox". - New `Adapter.UserExists(email)` (HTTP + mock). - `POST /v1/tenants` checks it before creating anything and returns **409 `email_taken`**. If the lookup itself fails, it falls through to the existing best-effort path. - Tests: server (`eachStore`), HTTP adapter (found / missing / lookup error), mock. The portal shows a German message for `email_taken` in a separate PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang added 1 commit 2026-09-23 21:31:38 +00:00
fix(signup): reject an email that already has an account
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 23m26s
ci / image (pull_request) Skipped
1d7e839a80
Signup created the tenant and the Keycloak organization before the
admin user; when the email already existed, provisioning failed after
the fact and left an admin-less workspace and an orphan organization,
while the portal told the person to check their inbox. createTenant now
asks Keycloak first and answers 409 email_taken without creating
anything.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang merged commit 0a26331ffd into main 2026-09-23 22:09:01 +00:00
Sign in to join this conversation.