Fix: Usar URL interna para debug webhook receiver (bypass authentik)
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m4s
This commit is contained in:
@@ -58,7 +58,16 @@ export default defineEventHandler(async (event) => {
|
||||
const controller = new AbortController()
|
||||
const timeout = setTimeout(() => controller.abort(), 10000)
|
||||
|
||||
const response = await fetch(webhook.url, {
|
||||
// Check if the URL is pointing to our own debug receiver
|
||||
// If so, use internal URL to bypass authentik
|
||||
let targetUrl = webhook.url
|
||||
if (webhook.url.includes('/api/debug/webhook-receiver')) {
|
||||
// Use internal URL (works in Docker/local environments)
|
||||
const internalPort = process.env.PORT || 3000
|
||||
targetUrl = `http://localhost:${internalPort}/api/debug/webhook-receiver`
|
||||
}
|
||||
|
||||
const response = await fetch(targetUrl, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
body,
|
||||
|
||||
Reference in New Issue
Block a user