Skip to content

feat(auth): admin del login real de un usuario (set-password, update email+identificador, diagnose, recovery links) - #22

Merged
boyander merged 1 commit into
mainfrom
feat/auth-user-admin-cli
Nov 3, 2026
Merged

boyander merged 1 commit into
mainfrom
feat/auth-user-admin-cli

Conversation

@boyander

@boyander boyander commented Nov 3, 2026

Copy link
Copy Markdown
Member

Un usuario no podía entrar porque el email que le dieron no era el de su cuenta, y el CLI/MCP ni lo veía ni lo arreglaba — hacía falta el dashboard. Esto lo cubre.

Lecturas

  • auth users get / get_auth_user: muestran credentials — el email/username que el usuario TECLEA en el login database, que puede diferir del email de perfil (y cuando difiere, ese desajuste es el bug).
  • auth users diagnose <identifier> / diagnose_auth_login: dado lo que tecleó la persona, dice en una llamada si entra; si no, si ese valor es el email de perfil de alguien que entra con otro identificador, y cuál es. Sugerencias por cercanía si no.
  • auth logs list / list_auth_logs: un login fallido no resuelve usuario, así que la fila muestra el identificador tecleado (ya guardado en el audit data, nunca surfaceado) — USER (tried) / attempted_identifier.

Escrituras (--writes)

  • auth users update / update_auth_user: email, name, email_verified; --email mueve también el identificador de la credencial database (--profile-only para no).
  • auth users set-password / set_auth_user_password: fija la clave directa (--generate, o stdin — nunca argv; el tool MCP la pasa por stdin).
  • auth users password-setup --print / get_auth_recovery_link, y auth users tickets list|revoke: acuñar y leer el enlace de reset para entregarlo por otro canal cuando el correo de la cuenta no recibe.

Todo envuelve métodos ya existentes del auth-sdk (userUpdate, credentials*, user tickets) — sin cambio en la management API. Tests unitarios de los shapes/flags/stdin de los tools MCP y del resolver de credencial. 106 tests mcp+auth en verde, tsc limpio.

…e email+identifier, diagnose, recovery links, and show the typed identifier

A user could not log in because the email they were given was not the one
their account signs in with, and the CLI/MCP could neither see that nor fix
it — the whole flow needed the dashboard. Now it does not.

Reads
- auth users get / get_auth_user: show `credentials` — the email/username the
  user actually TYPES at the database login, which can differ from the profile
  email (and when it does, that mismatch is the bug).
- auth users diagnose <identifier> / diagnose_auth_login: given what a person
  typed, say in one call whether it signs anyone in; if not, whether it is a
  user's profile email while they log in with another identifier, and what
  that identifier is. Near-match suggestions otherwise.
- auth logs list / list_auth_logs: a failed login resolves no user, so the row
  now shows the identifier that was typed (already stored in the audit data,
  just never surfaced) — "USER (tried)" / `attempted_identifier`.

Writes (--writes)
- auth users update / update_auth_user: change email, name, email_verified;
  --email also moves the database credential identifier so login keeps working
  (--profile-only to opt out).
- auth users set-password / set_auth_user_password: set the password directly
  (--generate, or stdin — never argv; the MCP tool pipes it on stdin).
- auth users password-setup --print / get_auth_recovery_link, and auth users
  tickets list|revoke: mint and read back a reset link to hand over by another
  channel when the account's email cannot receive it.

All wrap existing auth-sdk methods (userUpdate, credentials*, user tickets) —
no management-API change. Unit tests for the new MCP tool shapes/flags/stdin
and the credential resolver.
@boyander
boyander merged commit cee8d9d into main Nov 3, 2026
1 check passed
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 4.32.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@boyander
boyander deleted the feat/auth-user-admin-cli branch November 4, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant