Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

refactor(auth): extract OAuth capture to dedicated guard service#183

Open
runyaga wants to merge 2 commits intomainfrom
fix/181-oauth-capture-service
Open

refactor(auth): extract OAuth capture to dedicated guard service#183
runyaga wants to merge 2 commits intomainfrom
fix/181-oauth-capture-service

Conversation

@runyaga
Copy link
Copy Markdown
Collaborator

@runyaga runyaga commented Feb 4, 2026

Summary

  • Add OAuthCaptureGuard to enforce temporal constraint that OAuth callback params must be captured BEFORE GoRouter initializes
  • Guard throws descriptive StateError if params accessed without capture or if capture called twice
  • Makes implicit temporal dependency explicit and testable

Changes

  • lib/core/auth/oauth_capture_guard.dart: New guard class with global singleton
  • lib/run_soliplex_app.dart: Uses guard instead of passing params through override
  • lib/core/auth/auth_provider.dart: Provider reads from guard automatically
  • test/core/auth/oauth_capture_guard_test.dart: 7 unit tests for guard behavior

Test plan

  • All 7 new guard unit tests pass
  • All 7 auth callback screen tests pass
  • dart analyze reports 0 issues
  • dart format passes

Closes #181

Add OAuthCaptureGuard to enforce temporal constraint that OAuth callback
params must be captured BEFORE GoRouter initializes. The guard:

- Throws StateError if params accessed without capture
- Throws StateError if capture() called twice
- Provides descriptive error messages explaining the constraint
- Includes @VisibleForTesting reset() for test isolation

This makes the implicit temporal dependency explicit and testable,
preventing silent failures if initialization order changes.

Closes #181
@runyaga runyaga force-pushed the fix/181-oauth-capture-service branch from fe79e8d to 5f9a150 Compare February 4, 2026 05:53
Fix `require_trailing_commas` lint errors by reformatting multi-line
throwsA() calls with proper trailing commas on the inner having() results.
WilliamKarolDiCioccio pushed a commit to WilliamKarolDiCioccio/runyaga_soliplex_flutter that referenced this pull request Apr 13, 2026
…ate-messages

fix(client): deduplicate user messages on history replay
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(auth): extract OAuth callback capture to dedicated service

1 participant