Prepare OAuth debugger foundations for future learning lessons#1676
Open
chelojimenez wants to merge 1 commit intopnpfrom
Open
Prepare OAuth debugger foundations for future learning lessons#1676chelojimenez wants to merge 1 commit intopnpfrom
chelojimenez wants to merge 1 commit intopnpfrom
Conversation
Contributor
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| if (strategy === "cimd") return "CIMD (URL-based)"; | ||
| if (strategy === "dcr") return "Dynamic (DCR)"; | ||
| return "Pre-registered"; | ||
| }; |
There was a problem hiding this comment.
New shared export duplicates existing local function
Low Severity
The newly exported describeRegistrationStrategy in oauthFlowShared.ts is identical to the existing local describeRegistrationStrategy in OAuthProfileModal.tsx. Since this PR specifically extracts shared utilities, OAuthProfileModal could import from the shared module instead of maintaining its own copy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
useOAuthFlowControllerhook fromOAuthFlowTaband move flow orchestration, callback handling, modal timing, reset behavior, and token extraction into itOAuthFlowExperienceshell plus a small capability/config layer so server-backed debugger flows and future fixed-profile learning flows can reuse the same UI without route wiring yetTesting
npx vitest run client/src/components/oauth/__tests__/useOAuthFlowController.test.tsx client/src/components/oauth/__tests__/OAuthFlowExperience.test.tsx client/src/components/__tests__/OAuthFlowTab.test.tsxNotes
Note
Medium Risk
Moderate risk because OAuth flow orchestration and callback handling were refactored into a new hook and the debugger UI was re-composed, which could subtly affect auth modal timing, reset behavior, or token application despite aiming to preserve behavior.
Overview
Refactors the OAuth debugger tab to use a new
useOAuthFlowControllerhook for state-machine orchestration, OAuth callback processing (window message/BroadcastChannel), reset behavior, and token extraction, reducingOAuthFlowTabto app wiring + PostHog events.Introduces a reusable
OAuthFlowExperiencelayout with capability-gated actions viaoauthFlowShared(e.g., supporting future fixed-profile lesson flows without editing/apply/refresh controls), and updatesOAuthFlowLoggerto respect these capability flags.Simplifies
OAuthAuthorizationModalto only manage the popup lifecycle (callback listening moved to the controller), adds comprehensive unit tests for the tab/controller/experience, and updates test setup to mockHTMLElement.scrollTo.Written by Cursor Bugbot for commit 101a66d. This will update automatically on new commits. Configure here.