Skip to content

refactor(auth): rename AuthState variants, add ResumePoint enum, and guard onboarding completion#814

Merged
bmc08gt merged 1 commit into
code/cashfrom
refactor/auth-state-resume-point
May 31, 2026
Merged

refactor(auth): rename AuthState variants, add ResumePoint enum, and guard onboarding completion#814
bmc08gt merged 1 commit into
code/cashfrom
refactor/auth-state-resume-point

Conversation

@bmc08gt

@bmc08gt bmc08gt commented May 31, 2026

Copy link
Copy Markdown
Collaborator

Rename AuthState variants for clarity:

  • Registered → Onboarding
  • LoggedInAwaitingUser → Authenticating
  • LoggedInWithUser → Ready

Replace the seenAccessKey boolean on Onboarding with a ResumePoint enum (AccessKey, AccessKeyThenPurchase, PostAccessKey) so the onboarding resume point is fully determined at state-set time rather than derived from seenAccessKey + userFlags at navigation time.

Simplify buildNavGraphForLaunch to a pure structural mapping from ResumePoint to nav route, removing the userFlags parameter. Add resume-point reconciliation in RealSessionController.updateUserFlags() for the case where flags arrive after the initial state is set.

Fix a bug where killing the app at PostAccessKey and relaunching skipped the permissions phase entirely. A persisted completedOnboarding flag in PassphraseCredentialManager is now checked in AuthManager.login() before promoting to Ready, and set reactively when the composable completes the Onboarding → Ready transition.

…guard onboarding completion

Rename AuthState variants for clarity:
- Registered → Onboarding
- LoggedInAwaitingUser → Authenticating
- LoggedInWithUser → Ready

Replace the seenAccessKey boolean on Onboarding with a ResumePoint
enum (AccessKey, AccessKeyThenPurchase, PostAccessKey) so the
onboarding resume point is fully determined at state-set time rather
than derived from seenAccessKey + userFlags at navigation time.

Simplify buildNavGraphForLaunch to a pure structural mapping from
ResumePoint to nav route, removing the userFlags parameter. Add
resume-point reconciliation in RealSessionController.updateUserFlags()
for the case where flags arrive after the initial state is set.

Fix a bug where killing the app at PostAccessKey and relaunching
skipped the permissions phase entirely. A persisted completedOnboarding
flag in PassphraseCredentialManager is now checked in AuthManager.login()
before promoting to Ready, and set reactively when the composable
completes the Onboarding → Ready transition.

Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
@bmc08gt bmc08gt self-assigned this May 31, 2026
@github-actions github-actions Bot added type: refactor Code restructuring, no behavior change area: auth Login, session, access keys, identity area: network gRPC, connectivity, API, exchange rates area: deeplinks Deep link handling, URL routing, and link parsing area: session area: onboarding labels May 31, 2026
@bmc08gt bmc08gt merged commit 465bc5c into code/cash May 31, 2026
3 checks passed
@bmc08gt bmc08gt deleted the refactor/auth-state-resume-point branch May 31, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: auth Login, session, access keys, identity area: deeplinks Deep link handling, URL routing, and link parsing area: network gRPC, connectivity, API, exchange rates area: onboarding area: session type: refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant