fix: build share urls from auth_url instead of localhost

docker build sets next_public_app_url to localhost; preferring it over
runtime auth_url made prod share links point at localhost:3000.
This commit is contained in:
ginnoir
2026-07-18 17:22:58 -05:00
parent d1e295165a
commit 832e7265c9
4 changed files with 14 additions and 6 deletions
+8
View File
@@ -0,0 +1,8 @@
/** Public origin for absolute links. AUTH_URL wins — Docker build sets NEXT_PUBLIC to localhost. */
export function getAppPublicUrl(): string {
const raw =
process.env.AUTH_URL?.trim() ||
process.env.NEXT_PUBLIC_APP_URL?.trim() ||
"http://localhost:3000";
return raw.replace(/\/$/, "");
}