fix magic link
This commit is contained in:
@@ -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://<hash>: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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user