diff --git a/src/app/api/customer/verify/route.ts b/src/app/api/customer/verify/route.ts index 4132afd..8c017fc 100644 --- a/src/app/api/customer/verify/route.ts +++ b/src/app/api/customer/verify/route.ts @@ -11,5 +11,9 @@ export async function GET(req: Request) { const target = email ? `${prefix}/min-sida/oversikt` : `${prefix}/min-sida/verifiera`; - return NextResponse.redirect(new URL(target, url.origin)); + // Use the configured public origin — req.url.origin is the internal + // container host (e.g. http://:3000) when behind Traefik. + const base = + process.env.NEXT_PUBLIC_SITE_URL ?? process.env.AUTH_URL ?? url.origin; + return NextResponse.redirect(new URL(target, base)); }