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.
18 lines
429 B
TypeScript
18 lines
429 B
TypeScript
/**
|
|
* Protected API Endpoint
|
|
* Requires authentication - returns user-specific data
|
|
*/
|
|
export default defineEventHandler(async (event) => {
|
|
const session = await requireUserSession(event)
|
|
|
|
return {
|
|
message: 'Datos protegidos del usuario',
|
|
user: (session.user as any).username,
|
|
data: {
|
|
lotes: [],
|
|
permissions: (session.user as any).groups || []
|
|
},
|
|
timestamp: new Date().toISOString()
|
|
}
|
|
})
|