From a03d1e85410da6fe8dccd843af6ab446f30ff93e Mon Sep 17 00:00:00 2001 From: Ola Malmgren Date: Fri, 22 May 2026 23:20:45 +0200 Subject: [PATCH] fix magic link --- src/app/api/customer/verify/route.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)); }