Skip to content

fix(auth): harden macOS Google sign-in, session persistence, and login popup - #41

Open
mihaimetal wants to merge 1 commit into
NUber-dev:mainfrom
mihaimetal:fix/macos-auth
Open

mihaimetal wants to merge 1 commit into
NUber-dev:mainfrom
mihaimetal:fix/macos-auth

Conversation

@mihaimetal

@mihaimetal mihaimetal commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Harden macOS Google sign-in/out: per-account WebKit data stores, wipe residual HTTPStorages on sign-out, hand off via www.youtube.com, don’t interrupt 2FA.
  • Keep sessions alive with a stable WK data store + short-lived session-keeper refresh (then tear down the keeper).
  • Stop ad-hoc rebuilds from “logging you out”: cookie AES key is file-backed in Application Support only — no Keychain / no permission prompts.
  • Login popup: fail broken Google passkey/hybrid Bluetooth UI early and guide users to password / “Try another way” (Apple only allows real passkeys for browser-entitled apps).

Context

WKWebView does not isolate Google sessions the way WebView2 data_directory does. Extracted cookies also die without a real browser refresh. Separately, Keychain-bound encryption keys break across ad-hoc code signatures, which made every local rebuild look signed out and left successful Google logins stuck in the popup only. Passkeys for google.com cannot work in an embedded WebView without Apple’s browser-only entitlement.

Test plan

  • Sign in with Google on macOS using password (or Try another way) — popup should close and main app show the account
  • Quit and relaunch the same build — still signed in
  • Rebuild the app ad-hoc and relaunch — still signed in, no Keychain prompt
  • Sign out — next sign-in should not auto-use the previous Google session
  • Multi-account switch if applicable
  • Confirm Windows path unchanged (DPAPI cookies)

@mihaimetal

Copy link
Copy Markdown
Contributor Author

Rebased onto current main after 0.4.0 so this is a clean merge candidate against the release tree.

@mihaimetal mihaimetal changed the title fix(auth): harden macOS Google sign-in and sign-out fix(auth): harden macOS Google sign-in, session persistence, and login popup Jul 27, 2026
@mihaimetal
mihaimetal force-pushed the fix/macos-auth branch 2 times, most recently from 2021df6 to 10b176f Compare August 2, 2026 18:27
Seal cookie jars with an app-data AES key (mode 0600) instead of
macOS Keychain, so ad-hoc rebuilds no longer prompt for Keychain
access. Isolate login/keeper WebViews with per-account
data_store_identifier, inject a login script that fails WebAuthn so
Google offers password / another way, and keep 0.4.7's ServiceLogin
replay (NUber-dev#79) plus ytubic:// deep-link registration.

WEB_REMIX stream download (register_stream_source, no yt-dlp spawn)
lives in the same lib.rs overlay because spawn_downloader is not
separable from the auth helpers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant