Commit Graph

5 Commits

Author SHA1 Message Date
73aa55646b feat(invites): usar token del usuario actual para crear invite en Hub
Elimina la dependencia de HUB_ADMIN_EMAIL/HUB_ADMIN_PASSWORD del flujo
de invitaciones. Ahora se usa el Bearer token del usuario autenticado,
que debe tener role='admin' en su tenant dentro del Hub.

Esto hace el flujo compatible con instalaciones self-hosted donde el
cliente no debe tener acceso a credenciales del Workspace Hub.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 15:51:31 -05:00
02a5ac07ed fix(invites): logging detallado cuando Hub invite creation falla
Antes los fallos del Hub login y invite creation eran silenciosos o con
warning genérico. Ahora loguea status code, body y nombre de campo para
facilitar diagnóstico en producción.

- Detecta HUB_ADMIN_EMAIL/PASSWORD vacíos con error explícito
- Loguea status+body cuando login falla (401/403)
- Loguea status+body+tenant/email cuando invite falla (404/403)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 14:06:49 -05:00
831da7b31c refactor: remove unused base_url parameter from create_invite and update fallback URL logic 2026-05-12 10:04:35 -05:00
52fec4038e feat: implement lazy-link for pending invites and add hub_invite_token to InviteToken model
Co-authored-by: Copilot <copilot@github.com>
2026-05-07 12:41:12 -05:00
1f2f8d1f83 feat: implement user invitation system
- Add InviteToken model and Alembic migration (core.invite_tokens)
- Add invites module: DTOs, service (create/validate/consume), routes
- Register invites router in core router
- Extend auth register endpoint to support invite_token flow:
  - Validate local token, create user via Hub admin API (service account),
    handle existing user (link instead of duplicate), create UserTenant, consume token
- Add GET /auth/register/check endpoint to validate token without consuming
- Add HUB_ADMIN_EMAIL, HUB_ADMIN_PASSWORD, APP_PUBLIC_URL to config
- Frontend: add invite() method and types to users.ts API client
- Frontend: add invite dialog with real roles dropdown to users page
- Frontend: update register page to handle invite flow and user-exists case
2026-05-06 16:57:29 -05:00