Commit Graph

64 Commits

Author SHA1 Message Date
ca3b23c1d3 Fix: Agregar v-if al modal de editar perfil para evitar clicks inesperados
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 52s
Se agregó v-if="isOpen" al UModal para que solo se renderice en el DOM cuando
esté abierto. Esto soluciona el problema de que el modal se activaba al hacer
clic en áreas vacías del componente.
2025-10-16 20:21:53 -06:00
c05da4c797 test
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 53s
2025-10-16 20:09:20 -06:00
dbdff1961c Fix: Combinar jobs build y deploy en uno solo para evitar bug de dependencias
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 9s
2025-10-16 20:06:21 -06:00
1bf8d14df6 Fix: Eliminar --no-cache del docker build para mejorar velocidad
Some checks failed
build-and-deploy / build (push) Successful in 9s
build-and-deploy / deploy (push) Has been cancelled
2025-10-16 20:05:19 -06:00
d36138f9bd Test: Verificar Actions después de reiniciar todos los servicios
Some checks failed
build-and-deploy / deploy (push) Has been cancelled
build-and-deploy / build (push) Has been cancelled
2025-10-16 19:57:30 -06:00
72bd669b3b Test: Verificar Actions después de limpiar queues
Some checks failed
build-and-deploy / build (push) Successful in 2m17s
build-and-deploy / deploy (push) Has been cancelled
2025-10-16 19:52:25 -06:00
8d1948a6fd Test: Verificar que Gitea Actions funciona después de reiniciar runner 2025-10-16 19:50:44 -06:00
67261cd1fc Fix: Corregir errores de TypeScript en componentes
- Instalar @types/node para resolver referencias a process
- Corregir colores inválidos en componentes (orange→warning, purple→secondary, gray→neutral, etc.)
- Agregar tipos explícitos en GroupCheckButton y EditProfileButton
- Eliminar propiedad timeout inválida en toasts
2025-10-16 19:42:00 -06:00
fa0475efbf fix 2025-10-16 19:32:37 -06:00
bcf9efa89d fix 2025-10-16 19:24:43 -06:00
72712840b0 Test: Separar comandos git para hook correcto
Este commit demuestra la ejecución separada de comandos git:
- git add -A (paso 1)
- git commit (paso 2)
- git push (paso 3 - ejecutará el hook una sola vez)
2025-10-16 19:11:02 -06:00
b1caa15089 Trigger: Reintentar build del fix user.ts
El build anterior del commit b6a58e8 no completó el push de las
imágenes Docker al registro. Este commit trivial triggerea el
workflow de nuevo para que se complete correctamente el build
y deploy del fix que unifica user.ts (GET y PATCH en un solo archivo).
2025-10-16 19:02:00 -06:00
b6a58e8df7 Fix: Combinar endpoints API en un solo archivo user.ts
PROBLEMA IDENTIFICADO:
Nuxt 4 no reconoce archivos con extensiones como .get.ts y .patch.ts
en el directorio server/api/. Esto causaba que los endpoints no se
compilaran en el build final.

SOLUCIÓN:
- Eliminados: user.get.ts y user.patch.ts
- Creado: user.ts que maneja ambos métodos HTTP (GET y PATCH)
- Usa event.method para distinguir entre GET y PATCH
- Devuelve 405 para métodos no permitidos

Este cambio debería permitir que Nuxt compile correctamente los
endpoints de la API de Authentik para edición de perfil.
2025-10-16 18:41:41 -06:00
705fb58555 Fix: Agregar --no-cache al docker build para incluir API endpoints
All checks were successful
build-and-deploy / build (push) Successful in 2m22s
build-and-deploy / deploy (push) Successful in 3s
Se agregó la flag --no-cache al comando docker build para forzar
una reconstrucción completa de la imagen Docker sin usar cache.

Esto asegura que los endpoints de la API de Authentik
(/api/authentik/user GET y PATCH) se incluyan correctamente
en la imagen compilada.
2025-10-16 18:19:00 -06:00
9140a52160 Force Docker rebuild to include API endpoints
All checks were successful
build-and-deploy / build (push) Successful in 56s
build-and-deploy / deploy (push) Successful in 4s
Se agregó un comentario al código para forzar que Docker
reconstruya la imagen y así incluya los endpoints de la API
de Authentik que faltaban en el build anterior.

Los endpoints /api/authentik/user (GET y PATCH) existen en
el código fuente pero no fueron incluidos en la imagen Docker
debido a cache.
2025-10-16 18:00:42 -06:00
01c4b97905 Fix: Agregar variables de Authentik al workflow de deploy
All checks were successful
build-and-deploy / build (push) Successful in 7s
build-and-deploy / deploy (push) Successful in 3s
Se agregaron las variables de entorno de Authentik al job de deploy
para que se pasen correctamente al docker-compose:
- NUXT_AUTHENTIK_API_TOKEN (secret)
- NUXT_AUTHENTIK_API_URL (variable)
- NUXT_PUBLIC_AUTHENTIK_URL (variable)

Esto permitirá que el contenedor tenga acceso al token de la API
de Authentik y pueda funcionar la edición de perfil.
2025-10-16 17:56:58 -06:00
128ae5a256 Fix: Agregar variables de entorno de Authentik API al contenedor
All checks were successful
build-and-deploy / build (push) Successful in 7s
build-and-deploy / deploy (push) Successful in 3s
Se agregaron las variables de entorno necesarias para que el backend
pueda conectarse a la API de Authentik:
- NUXT_AUTHENTIK_API_TOKEN: Token de autenticación para la API
- NUXT_AUTHENTIK_API_URL: URL del servidor Authentik
- NUXT_PUBLIC_AUTHENTIK_URL: URL pública de Authentik

Esto corrige el problema donde la API de perfil devolvía HTML
en lugar de JSON porque no tenía acceso al token de Authentik.
2025-10-16 17:54:10 -06:00
248af8f8d1 Initial commit: Add Nuxt app with Authentik integration and profile editing
All checks were successful
build-and-deploy / build (push) Successful in 58s
build-and-deploy / deploy (push) Successful in 3s
- Add Nuxt 4 application with Authentik Proxy Outpost integration
- Add EditProfileButton component for editing user profile via Authentik API
- Add API endpoints for Authentik user management (GET/PATCH)
- Configure Gitea Actions workflow for automated deployment
- Add monitoring hook for Gitea Actions
- Configure environment variables and Docker Compose setup
2025-10-16 17:14:49 -06:00
43bcf4a647 Add modular group verification system with frontend and backend checks
This commit implements a comprehensive, reusable group verification system:

Components:
- GroupCheckButton: Base component for group verification
- 7 specialized buttons: 3 real groups (authentik Admins, grupo-prueba, lvl0), 1 public access test, 2 system verification buttons
- All buttons support both frontend and backend verification modes

Backend:
- New API endpoint /api/auth/check-group for server-side group validation
- Reads Authentik headers and validates group membership

Frontend:
- Enhanced useAuthentik composable with hasGroup() and checkGroupBackend() methods
- Toast notifications for all verification results
- Smooth animations and color-coded visual feedback

UI Improvements:
- Organized layout with cards for different verification types
- Grid layout for group buttons
- Professional styling with hover effects and shadows
- Clear visual distinction between frontend/backend checks
2025-10-13 04:09:42 -06:00
f52f9f393f Add temporary debug endpoint to inspect all headers 2025-10-13 03:40:36 -06:00
1c901fa877 Remove debug endpoint 2025-10-13 03:21:59 -06:00
96fac68c6d Enhance user metadata display with app and outpost information
- Update AuthentikUser interface to include appSlug and outpostName
- Capture x-authentik-meta-app and x-authentik-meta-outpost headers
- Improve UserMetadata component to display connection information
- Filter empty groups from groups array
- Add documentation about available Authentik headers
2025-10-13 03:20:05 -06:00
1cba2f427e Add debug endpoint to inspect Authentik headers 2025-10-13 03:16:36 -06:00
65dee7382f Add comprehensive documentation for components, Traefik and Authentik
- Document all authentication components architecture
  - UserAvatar, UserMetadata components
  - Individual action buttons with their specific functionality
  - useAuthentik() composable with full API documentation

- Explain Authentik Proxy Outpost flow
  - Forward Auth mechanism
  - Step-by-step authentication flow
  - Advantages of proxy-based authentication

- Detail Traefik routing configuration
  - Router 1: Public routes (PWA resources) with priority 100
  - Router 2: Protected routes with Authentik middleware
  - CORS and headers middleware explanation

- Add complete Authentik setup guide
  - Traefik middleware configuration
  - Authentik Provider and Application setup
  - Network configuration requirements

- Include troubleshooting section
  - Common errors and solutions
  - PWA offline functionality
  - Headers debugging
2025-10-13 03:11:46 -06:00
3f5c4bc820 Fix TypeScript errors in useAuthentik composable
- Add AuthentikUser and AuthStatusResponse interfaces
- Fix toast color from 'gray' to 'neutral' (valid color)
- Remove invalid 'timeout' property from toast.add()
- Fix toast action from 'click' to 'onClick'
- Add proper type annotations for error handling
- Replace process.server with import.meta.server
- Make email, name, uid optional in AuthentikUser interface
2025-10-13 03:05:04 -06:00
d8f70f2aa5 Refactor auth components into individual button components
- Remove StatusBadges component (badges for authenticated, connected, groups)
- Remove ActionButtons component
- Create individual button components:
  - SessionStatusButton: handles session status check
  - ProfileButton: navigates to user profile
  - LogoutButton: handles user logout
  - LoginButton: reloads page to trigger login
- Update app.vue to use new individual button components
- Improve code quality with better component separation and reusability
2025-10-13 03:00:02 -06:00
0fd25e34e6 Update offline.html with SSR+Auth limitation explanation
- Revert CacheFirst strategy back to NetworkFirst
- Add clear technical explanation in offline.html
- Explain that full offline mode requires no-auth or SPA
- Note that UI remains functional if app is already open
2025-10-13 02:45:57 -06:00
e3fc6c924a Add offline.html to public routes (no authentication required)
This allows the service worker to cache offline.html without Authentik redirecting to login.
2025-10-13 02:39:36 -06:00
496ff7630b Add offline fallback page for PWA
- Create offline.html with user-friendly offline message
- Auto-redirect when connection is restored
- Use offline.html as navigateFallback instead of root
- Include offline.html in PWA assets for precaching

This ensures users see a proper offline page when opening the app without connection, instead of a browser error.
2025-10-13 02:37:34 -06:00
ec9ccece61 Improve document caching strategy for offline navigation
- Add navigateFallbackDenylist to exclude API and auth routes
- Enhanced urlPattern to match document destination and root path
- Increase cache entries to 50 and duration to 7 days
- Add cacheableResponse for better cache control

This should enable the app to open offline after being loaded once.
2025-10-13 02:34:14 -06:00
e59f7b653d Add NetworkFirst caching strategy for navigation requests
This enables offline navigation by caching HTML documents generated by SSR.
When offline, users can now navigate to cached pages using the service worker.
2025-10-13 02:27:32 -06:00
0a7c8d9cd0 Fix Workbox configuration: remove networkTimeoutSeconds from NetworkOnly handler 2025-10-13 02:24:17 -06:00
87ae5b95e6 Improve PWA offline functionality and fix session caching
- Enable navigateFallback for offline navigation support
- Add JSON files to glob patterns for heroicons support
- Change Authentik API caching from NetworkFirst to NetworkOnly to prevent stale session data
- Add offline detection in checkSessionStatus with proper user feedback
- Add no-cache headers to /api/auth/status endpoint to prevent browser caching
- Show "Modo Offline" toast when user tries to check session while offline
2025-10-13 02:21:50 -06:00
226fcc7c64 Make 'Iniciar Sesión' button always visible alongside other buttons
Change button layout to show all 4 buttons at the same time:
- Estado de Sesión (info/blue)
- Ver Perfil (primary/blue)
- Cerrar Sesión (error/red)
- Iniciar Sesión (success/green) - NEW: always visible

This allows users to force a re-authentication by clicking 'Iniciar
Sesión' even when already authenticated, triggering Authentik login flow.
2025-10-13 02:02:45 -06:00
a132fdfbf8 Add permanent 'Iniciar Sesión' button when not authenticated
Replace 'Ver Perfil' and 'Cerrar Sesión' buttons with a prominent
'Iniciar Sesión' button when user is not authenticated. The button
reloads the page to trigger Authentik login redirect.

This provides a more accessible way to log in compared to the toast
button, which can be difficult to click.

Button layout:
- Authenticated: [Estado de Sesión] [Ver Perfil] [Cerrar Sesión]
- Not authenticated: [Estado de Sesión] [Iniciar Sesión]
2025-10-13 01:56:42 -06:00
5676647f0f Add login button to 'No Session' toast notifications
Add 'Iniciar Sesión' button to toasts when session is not active.
Clicking the button reloads the page, triggering Authentik redirect
to login flow.

Also increased toast timeout from 5s to 10s to give users more time
to see and click the login button.
2025-10-13 01:52:33 -06:00
00c5657b0a Handle session expiration correctly and fix icon CORS errors
- Detect CORS/redirect errors from Authentik and interpret them as
  "no session" instead of generic error
- When session expires, Authentik returns 302 redirect to login which
  causes CORS error in fetch requests
- Add /api/_nuxt_icon/ to public routes to prevent icon load failures
  after logout

This fixes the issue where logout in Authentik showed "Error" instead
of "Sin Sesión" when checking session status.
2025-10-13 01:49:20 -06:00
f6ba3dff5e Fix session status check to preserve authentication state
Remove /api/auth/status from public routes so it receives Authentik headers.
Remove logic that was clearing local auth state, which caused the page to
show "No autenticado" even when user was authenticated.

Now the button only displays session status without modifying the UI state.
2025-10-13 01:40:49 -06:00
ddea20376d Fix API endpoint location for Nuxt server structure
Move /api/auth/status endpoint from app/server/ to server/ directory.
Nuxt expects server API routes to be in /server/api/, not /app/server/api/.

This fixes the issue where the endpoint was returning HTML instead of JSON.
2025-10-13 01:33:10 -06:00
51767ff0d3 Add /api/auth/status to public routes
Make the session status check endpoint publicly accessible so it can
respond even when there's no Authentik session. This allows the
endpoint to return {"authenticated": false} instead of being
redirected to login.

Without this, Authentik intercepts the request and returns HTML
login page instead of JSON response.
2025-10-13 01:31:41 -06:00
2fc478dd07 Make session status check query Authentik actively
Create real-time session verification against Authentik:
- Add /api/auth/status endpoint that reads Authentik headers live
- Modify checkSessionStatus() to fetch from API instead of local state
- Show "Verifying..." toast while checking
- Sync local state with actual Authentik session status
- Handle connection errors gracefully

This ensures the status check reflects the current Authentik session,
not just the cached local state.
2025-10-13 01:27:51 -06:00
b7285316cf Add session status check button
Add new button to check and display current session status:
- New checkSessionStatus() function in useAuthentik composable
- Displays toast notification with session info
- Shows user name if authenticated or warning if not
- Add UNotifications component to app.vue to render toasts

This allows users to quickly verify their authentication status.
2025-10-13 01:20:45 -06:00
5646a84be1 Fix CORS error for PWA manifest by splitting Traefik routing
Split routing into two routers with different priorities:
- Public router (priority 100) handles PWA resources without authentication
- Protected router (priority 10) handles application routes with Authentik

Add CORS middleware for public PWA resources to allow cross-origin access
to manifest.webmanifest, service worker, and icons.

Fixes intermittent ERR_FAILED 302 and CORS errors when loading PWA manifest
from authenticated sessions.
2025-10-13 01:16:56 -06:00
ea94393fc7 Add maskable icon with solid background for Windows taskbar
- Created icon-maskable.svg with full background (no transparency)
- Generated icon-512x512-maskable.png with 90% safe zone
- Updated manifest to use dedicated maskable icon
- Fixes white background issue on Windows taskbar/topbar
2025-10-13 01:09:52 -06:00
9e66842322 Separate icon purposes to avoid any maskable warning
- Split icon-512x512.png into two separate entries
- One with purpose 'any' and one with purpose 'maskable'
- Avoids platform padding issues with combined purposes
2025-10-13 01:00:02 -06:00
da75f32874 Remove tablet screenshot from PWA manifest
- Keep only desktop (wide) and mobile (narrow) screenshots
- Reduces manifest size and focuses on primary form factors
2025-10-13 00:56:31 -06:00
c19649f0ee Fix PWA icon dimensions and remove duplicate
- Update icon-192x192.png to correct size 500x192 (was incorrectly declared as 192x192)
- Merge duplicate icon-512x512.png entries into single icon with 'any maskable' purpose
- Eliminates manifest warnings for icon size mismatches
2025-10-13 00:52:01 -06:00
512dccd2af Fix screenshot dimensions in PWA manifest
- Update desktop screenshot to 1920x1080 (was 1280x720)
- Update mobile screenshot to 614x853 (was 375x667)
- Keep tablet screenshot at 768x1024 (correct)
2025-10-13 00:44:14 -06:00
d84f78ca2a Add PWA screenshots and window controls overlay
- Add screenshots to manifest (desktop, tablet, mobile)
- Enable window-controls-overlay for Windows compact mode
- Fix deprecated apple-mobile-web-app-capable warning
- Add mobile-web-app-capable meta tag
2025-10-13 00:39:30 -06:00
85cc2306d5 Fix PWA manifest link injection and navigateFallback error
- Add useHead() in app.vue to inject manifest and PWA meta tags
- Set navigateFallback to undefined to prevent non-precached-url error
- Add includeAssets configuration for PWA module
- Fixes service worker error on initial page load

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-13 00:20:19 -06:00