docker build sets next_public_app_url to localhost; preferring it over runtime auth_url made prod share links point at localhost:3000.
9 lines
308 B
TypeScript
9 lines
308 B
TypeScript
/** 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(/\/$/, "");
|
|
}
|