Skip to content

ASC sign-in never remembers "Trust This Browser" — re-prompts on every single login #27

Description

@24leviii-arch

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions