Commit Graph

12 Commits

Author SHA1 Message Date
b9ba7a80db Clean up codebase and prepare as template
All checks were successful
build-and-deploy / build (push) Successful in 2m1s
build-and-deploy / deploy (push) Successful in 4s
Remove unused files and code:
- Delete test/debug endpoints (test.get.ts, public.get.ts, user.get.ts, debug-config backup)
- Remove unused OAuth wrapper (oauth-authentik.ts)
- Clean up debug console.log statements
- Simplify code comments

Fix TypeScript errors:
- Add @types/node dependency
- Create index.d.ts with User interface extension
- Fix UButton color props (red→error, gray→neutral)
- Add type assertions in protected.get.ts

Update documentation:
- Enhance README.md as template documentation
- Update SETUP.md with correct API routes (/api/auth/* instead of /auth/*)
- Add NUXT_OAUTH_AUTHENTIK_SERVER_URL_INTERNAL documentation
- Update endpoint documentation

This commit prepares the repository to be used as a template for future Nuxt 4 + Authentik OAuth projects.
2025-10-11 19:18:52 -06:00
174e9565b8 Fix logout navigation to use window.location.href
All checks were successful
build-and-deploy / build (push) Successful in 29s
build-and-deploy / deploy (push) Successful in 3s
Use window.location.href instead of navigateTo for API route to ensure
proper server-side logout handling.
2025-10-11 19:04:36 -06:00
1269b2e489 Fix SSR error with navigator.onLine in index page
All checks were successful
build-and-deploy / build (push) Successful in 30s
build-and-deploy / deploy (push) Successful in 3s
Use reactive ref with onMounted to safely access navigator.onLine
only on client-side, preventing server-side rendering errors.
2025-10-11 19:02:23 -06:00
db4a79e617 Add internal Authentik URL for server-to-server communication
All checks were successful
build-and-deploy / build (push) Successful in 7s
build-and-deploy / deploy (push) Successful in 3s
This fixes ETIMEDOUT errors when exchanging OAuth tokens. The container
now uses the Docker internal service name (authentiknucleo-server-1:9000)
for server-to-server API calls while keeping the public URL for browser
redirects.

Changes:
- Add NUXT_OAUTH_AUTHENTIK_SERVER_URL_INTERNAL env var
- Use internal URL for token exchange and userinfo endpoints
- Update docker-compose.yml and Gitea workflow
2025-10-11 18:47:41 -06:00
c681c8579d Fix OAuth login navigation - use full page reload instead of SPA navigation
All checks were successful
build-and-deploy / build (push) Successful in 31s
build-and-deploy / deploy (push) Successful in 4s
The /api/auth/authentik endpoint is a server redirect, not a Nuxt route.
Changed from navigateTo() to window.location.href for proper HTTP redirect.
2025-10-11 18:28:02 -06:00
2f625b95d0 Add test endpoint to verify auth subfolder works
All checks were successful
build-and-deploy / build (push) Successful in 9s
build-and-deploy / deploy (push) Successful in 3s
2025-10-11 18:03:34 -06:00
4d3aad3506 Move auth routes to server/api/auth/
All checks were successful
build-and-deploy / build (push) Successful in 8s
build-and-deploy / deploy (push) Successful in 3s
BREAKING CHANGE: Auth routes moved from /auth/* to /api/auth/*

- Move server/routes/auth/ to server/api/auth/
- Update login.vue to use /api/auth/authentik
- Update UserMenu.vue to use /api/auth/logout
- Remove old server/routes/ structure
- server/api/ is better supported in Nuxt 4

IMPORTANT: Update these in Gitea:
- Variable NUXT_OAUTH_AUTHENTIK_REDIRECT_URL to: https://seguidordelotes.nucleoriofrio.com/api/auth/authentik
- Update Authentik redirect URI to: https://seguidordelotes.nucleoriofrio.com/api/auth/authentik
2025-10-11 17:57:56 -06:00
2dbd2222af Add flat route files with dot notation
All checks were successful
build-and-deploy / build (push) Successful in 30s
build-and-deploy / deploy (push) Successful in 3s
- Add server/routes/auth.authentik.get.ts
- Add server/routes/auth.logout.get.ts
- Test if dot notation creates nested routes /auth/authentik
- Keep auth/ folder as backup
2025-10-11 17:52:38 -06:00
986d127c03 Refactor auth route to use defineEventHandler
All checks were successful
build-and-deploy / build (push) Successful in 30s
build-and-deploy / deploy (push) Successful in 3s
- Convert oauthAuthentikEventHandler wrapper to inline defineEventHandler
- Add detailed logging for OAuth flow debugging
- Follow Nuxt 4 server/routes/ convention
- Should fix 404 error on /auth/authentik
2025-10-11 17:46:48 -06:00
3b10aeed9e Add debug logging and config endpoint
All checks were successful
build-and-deploy / build (push) Successful in 7s
build-and-deploy / deploy (push) Successful in 3s
- Add console.log in oauth-authentik.ts to debug config
- Add /api/debug-config endpoint to verify env vars
- Helps diagnose missing serverUrl issue
2025-10-11 17:33:15 -06:00
3de76369c0 Fix OAuth authentication route
All checks were successful
build-and-deploy / build (push) Successful in 31s
build-and-deploy / deploy (push) Successful in 3s
- Add missing import for oauthAuthentikEventHandler
- Remove default placeholder URLs in nuxt.config.ts
- Fixes 404 error on /auth/authentik endpoint
2025-10-11 17:30:14 -06:00
7612487d3f Add Nuxt 4 app with OAuth/OIDC authentication and PWA support
All checks were successful
build-and-deploy / build (push) Successful in 2m7s
build-and-deploy / deploy (push) Successful in 3s
- Integrated Authentik OAuth/OIDC authentication
- Added PWA functionality with offline support
- Created protected and public API endpoints
- Configured Docker deployment with Traefik
- Added Gitea Actions CI/CD workflow
- Included comprehensive setup documentation
2025-10-11 17:12:05 -06:00