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

-14
View File
@@ -1,14 +0,0 @@
import { settleWithin } from "@/lib/async/settle-within";
import { loadDocument } from "@/lib/navigation/load-document";
import { clearOfflineCachesForSessionEnd } from "@/lib/pwa/query-persister";
/**
* Leave for the identity provider. The session starts on the way back, so
* the last account's offline copies go first. The wait for them is capped:
* WebKit can leave an IndexedDB open hanging after the installed app returns
* from the background, and the button must still work then.
*/
export async function leaveForSingleSignOn(url: string): Promise<void> {
await settleWithin(clearOfflineCachesForSessionEnd(), 1_500, undefined);
loadDocument(url);
}
+12
View File
@@ -0,0 +1,12 @@
import { settleWithin } from "@/lib/async/settle-within";
import { clearOfflineCachesForSessionEnd } from "@/lib/pwa/query-persister";
/**
* The session-end wipe before the page leaves for the identity provider,
* where the next session starts. The wait is capped: WebKit can leave an
* IndexedDB open hanging after the installed app returns from the
* background, and the button must still work then.
*/
export function clearOfflineCachesBeforeLeaving(): Promise<void> {
return settleWithin(clearOfflineCachesForSessionEnd(), 1_500, undefined);
}