[PR #6529] [PM-32122] Add cookie acquisition navigation #12790

Closed
opened 2026-04-11 03:51:18 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/bitwarden/android/pull/6529

State: closed
Merged: Yes


🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-32122

📔 Objective

Add cookie acquisition as a top-level destination in the outer NavHost (alongside root navigation and debug menu) so it can overlay the app without interfering with the state-based navigation in RootNavScreen.

MainViewModel monitors the cookie acquisition request flow combined with user/vault state and emits a one-shot NavigateToCookieAcquisition event when conditions are met. Dismissal is handled by the child CookieAcquisitionViewModel via a NavigateBack event (implementing BackgroundEvent to survive Custom Tab lifecycle transitions), which triggers popBackStack through an onDismiss callback.

Wire the AuthCallback deeplink so cookie results from the browser are delivered back to the auth repository's cookie callback result flow.

Add debug menu controls for triggering cookie acquisition manually during development.

🧪 Testing

  1. Log in and unlock the vault
  2. Open the debug menu and tap "Trigger cookie acquisition"
  3. Verify the cookie acquisition screen slides up
  4. Tap "Launch browser" — verify custom tab opens
  5. Simulate the deeplink callback: adb shell am start -a android.intent.action.VIEW -d "bitwarden://sso_cookie_vendor?cookie=value&d=1" — verify the screen auto-dismisses
  6. Tap "Continue without syncing" — verify the screen dismisses
  7. Tap "Why am I seeing this?" — verify help URL opens

📸 Screenshots

**Original Pull Request:** https://github.com/bitwarden/android/pull/6529 **State:** closed **Merged:** Yes --- ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-32122 ## 📔 Objective Add cookie acquisition as a top-level destination in the outer NavHost (alongside root navigation and debug menu) so it can overlay the app without interfering with the state-based navigation in RootNavScreen. MainViewModel monitors the cookie acquisition request flow combined with user/vault state and emits a one-shot NavigateToCookieAcquisition event when conditions are met. Dismissal is handled by the child CookieAcquisitionViewModel via a NavigateBack event (implementing BackgroundEvent to survive Custom Tab lifecycle transitions), which triggers popBackStack through an onDismiss callback. Wire the AuthCallback deeplink so cookie results from the browser are delivered back to the auth repository's cookie callback result flow. Add debug menu controls for triggering cookie acquisition manually during development. ## 🧪 Testing 1. Log in and unlock the vault 2. Open the debug menu and tap "Trigger cookie acquisition" 3. Verify the cookie acquisition screen slides up 4. Tap "Launch browser" — verify custom tab opens 5. Simulate the deeplink callback: `adb shell am start -a android.intent.action.VIEW -d "bitwarden://sso_cookie_vendor?cookie=value&d=1"` — verify the screen auto-dismisses 6. Tap "Continue without syncing" — verify the screen dismisses 7. Tap "Why am I seeing this?" — verify help URL opens ## 📸 Screenshots <video src="https://github.com/user-attachments/assets/19583d35-3807-4dd1-b010-e526e40c514d" width="365" />
GiteaMirror added the pull-request label 2026-04-11 03:51:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#12790