josedario87 1ea50f0aa5
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 46s
Solucionar errores de CORS manteniendo seguridad de Authentik
PROBLEMA:
- Frontend hacía fetch a APIs protegidas por Authentik
- Cuando sesión expiraba, Authentik redirigía causando error de CORS
- TypeError: Failed to fetch

SOLUCIÓN:
1. Backend inyecta window.__AUTHENTIK_USER__ en HTML inicial (app.js)
   - Servidor lee headers de Authentik y los pasa al frontend
   - Evita fetch innecesario en carga inicial

2. Frontend usa window.__AUTHENTIK_USER__ como fuente principal (useAuthentik.js)
   - Solo hace fetch cuando se fuerza refresh
   - Detecta errores de CORS como señal de sesión expirada
   - Muestra mensaje claro al usuario

3. App.vue detecta errores de autenticación en APIs
   - Cuando fetch falla con CORS, recarga página automáticamente
   - Authentik manejará la re-autenticación

SEGURIDAD:
- Todos los endpoints /api/* siguen protegidos por Authentik
- No se exponen APIs sin autenticación
- Headers de Authentik solo presentes con sesión válida
2025-10-27 15:15:44 -06:00
fix
2025-09-26 20:49:50 -06:00
2025-09-26 19:55:12 -06:00
fix
2025-09-26 21:03:42 -06:00
2025-10-17 05:31:56 -06:00
2025-09-26 21:20:34 -06:00
Description
No description provided
10 MiB
Languages
Vue 48.6%
JavaScript 38.3%
HTML 5.9%
Shell 3.4%
CSS 2.3%
Other 1.5%