refactor(auth): navigate for single sign-on at the call sites again

Moving the navigation into the shared helper took both sign-in hand-offs
out of what the headerless-transport guard walks, which only reads the
component and page trees. The helper now only clears the offline copies
with the capped wait, and each page navigates itself. The device
registration test checks the end of the no-device rest inside the test
that already pairs an iPhone instead of a copy of it.
This commit is contained in:
Marc-André Bombeck committed 2026-11-12 14:19:47 +01:00
1 parent f78c9b0b78
commit ae005f020b
5 files changed
+22 -32

No files matched your search

+4 -2
View File
@@ -24,7 +24,7 @@ import { OIDC_MFA_COOKIE, OIDC_MFA_COOKIE_PATH } from "@/lib/auth/oidc-cookie";
import { isDashboardSnapshotEnabled } from "@/lib/dashboard/snapshot-flag";
import { prefetchDashboardSnapshot } from "@/lib/queries/use-dashboard-snapshot";
import { clearOfflineCachesForSessionEnd } from "@/lib/pwa/query-persister";
import { leaveForSingleSignOn } from "@/lib/auth/leave-for-single-sign-on";
import { clearOfflineCachesBeforeLeaving } from "@/lib/pwa/clear-before-leaving";
import { sanitizeSameOriginPath } from "@/lib/url-safety";
import { localizedSignInError } from "@/lib/api/localized-error";
import { formatDate } from "@/lib/format";
@@ -184,7 +184,9 @@ export default function LoginPage() {
params.set("client_proto", clientTransport.protocol);
params.set("client_host", clientTransport.host);
}
await leaveForSingleSignOn(`/api/auth/oidc/login?${params}`);
// The session starts on the way back; the last account's copies go first.
await clearOfflineCachesBeforeLeaving();
loadDocument(`/api/auth/oidc/login?${params}`);
}
function getRedirectTarget(): string {