You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Token creation reveals whether an email or phone number has an account #15991
POST /v1/account/tokens/magic-url, POST /v1/account/tokens/email and POST /v1/account/tokens/phone take a userId from the caller:
Unregistered address: the response's userId is the caller-supplied ID, which becomes the new user's ID.
Registered address: the response's userId is the existing account's real ID.
So one unauthenticated request with ID.unique() shows whether the address is registered. Rate limits are per address and per IP, so it takes one request per address.
Why it isn't a one-line fix
Clients need the returned userId. In the email/phone OTP flow the app calls createEmailToken(ID.unique(), email), then createSession(response.userId, otp). Returning the caller's ID for an existing account would break sign-in for every existing user.
Options
Opaque handle. Return an identifier that doesn't reveal the branch, such as a token or handle ID that createSession resolves server-side. This is an API change: SDKs and docs would pass the handle instead of userId, with a compatibility period.
Accept the address at exchange time.createSession takes the email or phone plus the secret, so the client never needs the real user ID before signing in. This is also an API change.
Accept it as design. Document that token creation reveals whether an account exists, keep the per-address and per-IP limits, and dismiss the remaining part of the alert. Many auth providers make the same trade-off for passwordless sign-in.
The choice belongs to the auth owners. Until then the confirmation routes no longer add a second way to check.
Activity
Sahilxrajput commentedon Nov 25, 2026
Hi, I'd like to work on this issue. Could you please assign it to me? Thanks!