diff --git a/src/hooks/common/use-frontend-base-url.ts b/src/hooks/common/use-frontend-base-url.ts index c11cd6e03..35eda38c9 100644 --- a/src/hooks/common/use-frontend-base-url.ts +++ b/src/hooks/common/use-frontend-base-url.ts @@ -8,6 +8,8 @@ import { useLocation } from 'react-router' export const useFrontendBaseUrl = (): string => { const { pathname } = useLocation() + const location = window.location + const cleanedPathName = location.pathname.replace(pathname, '') - return window.location.pathname.replace(pathname, '') + return `${location.protocol}//${location.host}${cleanedPathName}` }