diff --git a/webclient/src/api/client.js b/webclient/src/api/client.js index cdfa312..f763a3d 100644 --- a/webclient/src/api/client.js +++ b/webclient/src/api/client.js @@ -18,7 +18,7 @@ clearAccessToken(); const isLoginPage = window.location.hash.includes("/login"); if (!isLoginPage) { - window.location.href = `/auth/login?return_to=${encodeURIComponent(window.location.hash || "#/")}`; + window.location.href = `/proxy.php?path=/auth/login&return_to=${encodeURIComponent(window.location.href)}`; } } diff --git a/webclient/src/components/layout/AppShell.vue b/webclient/src/components/layout/AppShell.vue index df1e494..054b27b 100644 --- a/webclient/src/components/layout/AppShell.vue +++ b/webclient/src/components/layout/AppShell.vue @@ -116,8 +116,8 @@ } function handleLogin() { - const returnTo = window.location.hash || "#/"; - window.location.href = `/auth/login?return_to=${encodeURIComponent(returnTo)}`; + const returnTo = window.location.href; + window.location.href = `/proxy.php?path=/auth/login&return_to=${encodeURIComponent(returnTo)}`; } function closeDrawer() { diff --git a/webclient/src/features/auth/pages/LoginPage.vue b/webclient/src/features/auth/pages/LoginPage.vue index 3db7481..0c9b5d6 100644 --- a/webclient/src/features/auth/pages/LoginPage.vue +++ b/webclient/src/features/auth/pages/LoginPage.vue @@ -62,8 +62,8 @@ }); function handleLogin() { - const returnTo = window.location.hash || "#/"; - window.location.href = `/auth/login?return_to=${encodeURIComponent(returnTo)}`; + const returnTo = window.location.href; + window.location.href = `/proxy.php?path=/auth/login&return_to=${encodeURIComponent(returnTo)}`; } diff --git a/webclient/src/stores/auth.js b/webclient/src/stores/auth.js index a99566a..fb4faf5 100644 --- a/webclient/src/stores/auth.js +++ b/webclient/src/stores/auth.js @@ -67,8 +67,8 @@ } function redirectToLogin() { - const returnTo = window.location.hash || "#/"; - window.location.href = `/auth/login?return_to=${encodeURIComponent(returnTo)}`; + const returnTo = window.location.href; + window.location.href = `/proxy.php?path=/auth/login&return_to=${encodeURIComponent(returnTo)}`; } return {