Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

Revert changes to absolute-url (#194)

Luke Vellaf66670252780
diff --git a/src/utils/absolute-url.ts b/src/utils/absolute-url.ts
index a515ea5ed..d4f96c7fb 100644
--- a/src/utils/absolute-url.ts
+++ b/src/utils/absolute-url.ts
@@ -1,7 +1,13 @@
-export function absoluteUrl() {
- return process.env.NEXT_PUBLIC_BASE_URL ?? process.env.NEXT_PUBLIC_VERCEL_URL
+const getVercelUrl = () => {
+ return process.env.NEXT_PUBLIC_VERCEL_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_URL}`
- : typeof window !== "undefined"
- ? window.origin
- : "http://localhost:3000";
+ : null;
+};
+
+export function absoluteUrl() {
+ return (
+ process.env.NEXT_PUBLIC_BASE_URL ??
+ getVercelUrl() ??
+ "http://localhost:3000"
+ );
}