All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m3s
- Endpoint POST /api/debug/webhook-receiver para recibir webhooks - Almacenamiento en memoria de ultimos 100 eventos - Endpoint GET/DELETE para consultar/limpiar eventos - Nueva tab Webhooks en seccion Debug con polling cada 5s
24 lines
567 B
TypeScript
24 lines
567 B
TypeScript
/**
|
|
* GET /api/debug/webhook-events
|
|
* Get stored debug webhook events
|
|
*/
|
|
import { debugWebhookStore } from '../../services/debug/webhook-store'
|
|
|
|
export default defineEventHandler(async (event) => {
|
|
const username = getHeader(event, 'x-authentik-username')
|
|
if (!username) {
|
|
throw createError({ statusCode: 401, message: 'Unauthorized' })
|
|
}
|
|
|
|
const query = getQuery(event)
|
|
const limit = parseInt(query.limit as string) || 50
|
|
|
|
const events = debugWebhookStore.getEvents(limit)
|
|
|
|
return {
|
|
success: true,
|
|
count: events.length,
|
|
events
|
|
}
|
|
})
|