Description
Every time the Apple ID sign-in sheet (AppleIDLoginSheet) opens to refresh the ASC web session, Apple's 2FA flow asks to "Trust This Browser." Checking that box has no effect — the very next sign-in asks again, with no exceptions.
Root cause
ASCWebView.makeNSView configures its WKWebView with an ephemeral data store:
let config = WKWebViewConfiguration()
config.websiteDataStore = .nonPersistent()
.nonPersistent() is an in-memory-only store — everything (cookies, local storage, Apple's own device-trust cookie) is discarded the instant the WebView/sheet is deallocated. Since the WebView has zero memory of any previous session, idmsa.apple.com's identity servers see what looks like a brand-new, never-seen device/browser on every single sign-in and re-run full 2FA + the trust prompt. The checkbox literally cannot work, because there is no persistent storage for the resulting trust token to land in.
Fix
Opened as #26 — swaps .nonPersistent() for WKWebsiteDataStore(forIdentifier:) with a stable UUID, giving the WebView its own persistent-but-isolated (not shared with Safari) data store that survives across app launches. Verified swift build --target Blitz succeeds with the change; the cookie-capture/ASCWebSessionStore logic is untouched.
Impact
Every user hits this on every sign-in — it's not intermittent.
Description
Every time the Apple ID sign-in sheet (
AppleIDLoginSheet) opens to refresh the ASC web session, Apple's 2FA flow asks to "Trust This Browser." Checking that box has no effect — the very next sign-in asks again, with no exceptions.Root cause
ASCWebView.makeNSViewconfigures itsWKWebViewwith an ephemeral data store:.nonPersistent()is an in-memory-only store — everything (cookies, local storage, Apple's own device-trust cookie) is discarded the instant the WebView/sheet is deallocated. Since the WebView has zero memory of any previous session, idmsa.apple.com's identity servers see what looks like a brand-new, never-seen device/browser on every single sign-in and re-run full 2FA + the trust prompt. The checkbox literally cannot work, because there is no persistent storage for the resulting trust token to land in.Fix
Opened as #26 — swaps
.nonPersistent()forWKWebsiteDataStore(forIdentifier:)with a stable UUID, giving the WebView its own persistent-but-isolated (not shared with Safari) data store that survives across app launches. Verifiedswift build --target Blitzsucceeds with the change; the cookie-capture/ASCWebSessionStorelogic is untouched.Impact
Every user hits this on every sign-in — it's not intermittent.