From 694652dccd53e2cb96086de3e83b8d14478946a5 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sat, 14 Feb 2026 23:07:55 +0100 Subject: [PATCH] Fixed origin --- src/modules/getOrigin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/getOrigin.ts b/src/modules/getOrigin.ts index 82edadb..13fedd6 100644 --- a/src/modules/getOrigin.ts +++ b/src/modules/getOrigin.ts @@ -4,8 +4,8 @@ import { headers } from "next/headers"; export async function getOrigin(): Promise<{ protocol: string; host: string }> { const h = await headers(); - const host = h.get("host") || "localhost:3000"; - const protocol = h.get("x-forwarded-proto") ?? "https"; + const host = process.env.ORIGIN || h.get(":authority") || "localhost:3000"; + const protocol = h.get("x-forwarded-proto") || h.get(":scheme") || "https"; return { protocol, host }; }