diff --git a/ui/admin/app/lib/model/oauthApps/providers/github.ts b/ui/admin/app/lib/model/oauthApps/providers/github.ts index 7e63de1fb..cbdf990c4 100644 --- a/ui/admin/app/lib/model/oauthApps/providers/github.ts +++ b/ui/admin/app/lib/model/oauthApps/providers/github.ts @@ -21,7 +21,7 @@ const steps: OAuthFormStep[] = [ }, { type: "copy", - text: BaseUrl, + text: BaseUrl(), }, { diff --git a/ui/admin/app/lib/model/oauthApps/providers/google.ts b/ui/admin/app/lib/model/oauthApps/providers/google.ts index 3f07833b0..42506c553 100644 --- a/ui/admin/app/lib/model/oauthApps/providers/google.ts +++ b/ui/admin/app/lib/model/oauthApps/providers/google.ts @@ -114,7 +114,7 @@ const steps: OAuthFormStep[] = [ }, { type: "copy", - text: DomainUrl, + text: DomainUrl(), }, { type: "markdown", diff --git a/ui/admin/app/lib/routers/baseRouter.ts b/ui/admin/app/lib/routers/baseRouter.ts index 3846daaa0..09888a55a 100644 --- a/ui/admin/app/lib/routers/baseRouter.ts +++ b/ui/admin/app/lib/routers/baseRouter.ts @@ -1,2 +1,10 @@ -export const BaseUrl = window.location.origin + "/admin"; -export const DomainUrl = window.location.origin; +export const BaseUrl = () => { + if (typeof window === "undefined") return ""; + + return window.location.origin + "/admin"; +}; +export const DomainUrl = () => { + if (typeof window === "undefined") return ""; + + return window.location.origin; +};