Repository navigation
feat(auth): admin del login real de un usuario (set-password, update email+identificador, diagnose, recovery links) - #22
Merged
Conversation
…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.
|
🎉 This PR is included in version 4.32.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: muestrancredentials— 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;--emailmueve también el identificador de la credencial database (--profile-onlypara 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, yauth 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.