diff --git a/ui/src/Pages/LoginPage/loginUtilities.tsx b/ui/src/Pages/LoginPage/loginUtilities.tsx index 4f754032..5b53b3bb 100644 --- a/ui/src/Pages/LoginPage/loginUtilities.tsx +++ b/ui/src/Pages/LoginPage/loginUtilities.tsx @@ -12,7 +12,7 @@ export const INITIAL_SETUP_QUERY = gql` export function login(token: string) { saveTokenCookie(token) - window.location.href = '/' + window.location.href = `${import.meta.env.BASE_URL}` } export const Container = styled.div.attrs({ className: 'mt-20' })`` diff --git a/ui/src/components/photoGallery/ProtectedMedia.tsx b/ui/src/components/photoGallery/ProtectedMedia.tsx index 305f16d6..5b50bdd3 100644 --- a/ui/src/components/photoGallery/ProtectedMedia.tsx +++ b/ui/src/components/photoGallery/ProtectedMedia.tsx @@ -13,7 +13,10 @@ const placeholder = const getProtectedUrl = (url?: string) => { if (url == undefined) return undefined - const imgUrl = new URL(url, location.origin) + const imgUrl = new URL( + `${import.meta.env.BASE_URL}${url}`.replace(/\/\//g, '/'), + location.origin + ) const tokenRegex = location.pathname.match(/^\/share\/([\d\w]+)(\/?.*)$/) if (tokenRegex) { diff --git a/ui/src/index.tsx b/ui/src/index.tsx index 3c0d73f3..072b14ea 100644 --- a/ui/src/index.tsx +++ b/ui/src/index.tsx @@ -16,7 +16,7 @@ setupLocalization() const Main = () => ( - +