Skip to main content
From 2026.11.3, every sign-in starts by asking for the e-mail, in the MaihueGO app and in every web app (which sign in through horizon-authenticate). With the e-mail, horizon-api answers which methods that login has and the client shows only the ones that work: password, enabled providers or magic link (ADR 0134). UI copy is quoted in Spanish, as the app shows it.
Decision tree: the person types their e-mail and the client calls POST /api/v3/auth/verify-email, which returns the providers whose flag is on and has_created_password. An unknown e-mail goes to registration; a half-done registration only offers to finish it with its provider; an account with a password shows the password field and its providers; an account without a password linked to a provider shows the provider buttons and the magic link; a migrated account with neither only gets the magic link. 'Forgot password' on an account without a password sends the magic link with the same on-screen answer.

What sign-in shows after the e-mail

Step 1 · The e-mail: POST /api/v3/auth/verify-email

Public endpoint (permission auth:verify-email). The e-mail is normalised (lowercase, trimmed) and the lookup is exact and fails closed: a database error answers 500, never “does not exist” (ADR 0091).
Request
Anonymous response (main fields)
  • A caller with a Horizon JWT whose confirmed e-mail owns the profile gets the full payload (account, profile, dni_validated, has_subscription_product_history, the account’s created_at, etc.) plus providers.
  • The temporary server flag authenticate-verify-email-anonymous-profile (formerly the AUTH_VERIFY_EMAIL_ANONYMOUS_PROFILE variable), true in every environment until 2026-11-14, returns the full payload to everyone while older app versions need it; each use is logged as verify_email_anonymous_profile_compat. The production target is false.

Step 2 · The route table

The decision is a pure, unit-tested function on both clients (utils/verify-email-routing.ts in the app, the e-mail step action in horizon-authenticate). Two edge cases in the app:
  • Confirmed login, no account and with a password (half-done e-mail registration): the app carries on with registration (document validation).
  • Confirmed login, no account, no password and its provider’s flag is off: the app stays on the welcome screen, because there is no method to offer.
  • The routes after the e-mail are email-sent, confirm-email, login-full or login-anonymous (with password), sign-in-methods in passwordless mode (no password) or finish-registration mode (half-done registration), validate-dni and stay.
  • The methods screen (auth.sign-in-methods) replaces the old “stay” and “continue with Google” screens.
  • “Enviarme un enlace” leads to “Revisa tu correo”: “Te enviamos un enlace para entrar a MaihueGO. Vence en 1 hora y sirve una sola vez.” Resend unlocks after 60 seconds.
  • When the app reopens without a session, the same logic decides where to resume.
If verify-email fails in the app, a generic error is shown and the typed e-mail is kept.
The 2FA gate is inert today: the authenticate-two-factor-ui flag is off in every environment and there is no 2FA backend. The web only asks for the second step if the backend answers requires_2fa.

”Forgot password” without a password

A login without a password cannot recover one. In that case POST /api/v3/auth/recovery-account sends the sign-in magic link instead of the recovery e-mail, with the same answer and the same on-screen message. That way the screen does not reveal whether the account has a password. In the app: Details in Password and Magic link.

Step 3 · Password sign-in: POST /api/v3/auth/login/password

Permission auth:login-password. Body { "email": "…", "password": "…" }. If the login still had has_created_password set to false, a successful password sign-in fixes it (best-effort). Every sign-in method ends in the same service (LogicCommonService.loginCommon), so the payload is the same for password, provider and magic link.

Limits and the person’s IP

horizon-authenticate calls verify-email, magic-link/request, login/password and recovery from the server, so every call leaves from the same IP. That is why it sends the person’s real IP in x-auth-client-ip together with x-auth-bff-token, and horizon-api only counts by that IP when the token matches its AUTH_BFF_SERVER_TOKEN (ADR 0098). The IP is read from x-vercel-forwarded-for or x-real-ip.
If AUTH_BFF_SERVER_TOKEN is not the same in horizon-api and horizon-authenticate, every sign-in in the environment shares the server IP budget and verify-email answers 429 to everyone as soon as a handful of people sign in.

Accepted risk: enumeration

providers tells, for a given e-mail, which enabled provider it signs in with. That is extra information about whether an account exists. It was accepted on purpose (ADR 0134): the endpoint is rate-limited and returns no profile data to anonymous callers.

See also