From 0bdba15aca07d5c7a10896017e4e5b782c4db399 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Jun 2026 17:09:44 +0000 Subject: [PATCH 2/3] Fix bypass_autologin being overwritten by 403 interceptor during app init Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com> --- frontend/src/services/api/index.ts | 9 +++++++-- frontend/src/views/Auth/Login.vue | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/src/services/api/index.ts b/frontend/src/services/api/index.ts index 0d9aadb8f..b648b1596 100644 --- a/frontend/src/services/api/index.ts +++ b/frontend/src/services/api/index.ts @@ -74,9 +74,14 @@ api.interceptors.response.use( const params = new URLSearchParams(search); const fullPath = pathname + search; - // Don't redirect to login if already on an auth-exempt route + // Don't redirect to login if already on an auth-exempt route. + // Also resolve the route from the browser URL to handle the case where + // the router hasn't been started yet (e.g., during app initialization), + // which would otherwise cause router.currentRoute.value.name to be undefined. const currentRoute = router.currentRoute.value.name?.toString() ?? ""; - if (isAuthExemptRoute(currentRoute)) { + const resolvedRoute = router.resolve(window.location.pathname); + const resolvedRouteName = resolvedRoute.name?.toString() ?? ""; + if (isAuthExemptRoute(currentRoute) || isAuthExemptRoute(resolvedRouteName)) { return Promise.reject(error); } diff --git a/frontend/src/views/Auth/Login.vue b/frontend/src/views/Auth/Login.vue index 94c1ea180..1477027fb 100644 --- a/frontend/src/views/Auth/Login.vue +++ b/frontend/src/views/Auth/Login.vue @@ -2,7 +2,7 @@ import type { Emitter } from "mitt"; import { inject, onMounted, ref } from "vue"; import { useI18n } from "vue-i18n"; -import { useRouter } from "vue-router"; +import { useRoute, useRouter } from "vue-router"; import { refetchCSRFToken } from "@/services/api"; import identityApi from "@/services/api/identity"; import storeAuth from "@/stores/auth"; @@ -14,6 +14,7 @@ const heartbeatStore = storeHeartbeat(); const authStore = storeAuth(); const emitter = inject>("emitter"); const router = useRouter(); +const route = useRoute(); const username = ref(""); const password = ref(""); const visiblePassword = ref(false); @@ -97,8 +98,7 @@ async function loginOIDC() { } onMounted(async () => { - const params = new URLSearchParams(window.location.search); - const bypassAutologin = params.get("bypass_autologin") === "true"; + const bypassAutologin = route.query.bypass_autologin === "true"; if (oidcEnabled && oidcAutologin && !bypassAutologin) { loginOIDC(); } From ccb8d400e9982e6ae3badd64b4edd2198f5a1e0c Mon Sep 17 00:00:00 2001 From: Georges-Antoine Assi Date: Mon, 15 Jun 2026 13:47:32 -0400 Subject: [PATCH 3/3] run fmt --- frontend/src/services/api/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/services/api/index.ts b/frontend/src/services/api/index.ts index b648b1596..a5b0c9e88 100644 --- a/frontend/src/services/api/index.ts +++ b/frontend/src/services/api/index.ts @@ -81,7 +81,10 @@ api.interceptors.response.use( const currentRoute = router.currentRoute.value.name?.toString() ?? ""; const resolvedRoute = router.resolve(window.location.pathname); const resolvedRouteName = resolvedRoute.name?.toString() ?? ""; - if (isAuthExemptRoute(currentRoute) || isAuthExemptRoute(resolvedRouteName)) { + if ( + isAuthExemptRoute(currentRoute) || + isAuthExemptRoute(resolvedRouteName) + ) { return Promise.reject(error); }