Add debug endpoint to inspect Authentik headers
All checks were successful
build-and-deploy / build (push) Successful in 51s
build-and-deploy / deploy (push) Successful in 3s

This commit is contained in:
2025-10-13 03:16:36 -06:00
parent 65dee7382f
commit 1cba2f427e

View File

@@ -0,0 +1,23 @@
/**
* Debug endpoint para ver todos los headers que recibe el servidor
* Útil para inspeccionar qué headers envía Authentik Proxy
*/
export default defineEventHandler((event) => {
const headers = getHeaders(event)
// Filtrar solo los headers de Authentik
const authentikHeaders: Record<string, string> = {}
const allHeaders: Record<string, string> = {}
for (const [key, value] of Object.entries(headers)) {
allHeaders[key] = value
if (key.toLowerCase().startsWith('x-authentik-')) {
authentikHeaders[key] = value
}
}
return {
authentikHeaders,
allHeaders
}
})