Finally fixed origin

This commit is contained in:
2026-02-14 23:25:28 +01:00
parent 705d504cd7
commit 204f3754f2
+5 -1
View File
@@ -4,7 +4,11 @@ import "server-only";
export async function getOrigin(): Promise<{ protocol: string; host: string }> {
const h = await headers();
const host = process.env.ORIGIN || h.get(":authority") || "localhost:3000";
const protocol = h.get("x-forwarded-proto") || h.get(":scheme") || "https";
const protocol =
process.env.ORIGIN_PROTO ||
h.get("x-forwarded-proto") ||
h.get(":scheme") ||
"https";
return { protocol, host };
}