Redirect when a sign-in flow completes on its first step#4
Draft
madurangasiriwardena wants to merge 1 commit into
Draft
Redirect when a sign-in flow completes on its first step#4madurangasiriwardena wants to merge 1 commit into
madurangasiriwardena wants to merge 1 commit into
Conversation
The v2 SignIn handled terminal flow statuses (Complete/Error) only after a submission, not on the initial flow load. When a flow completes on its first step — e.g. a reused browser SSO session lets the backend return COMPLETE immediately with no UI components — the gate fell through with no components and spun on a loader forever. Extract the terminal-response handling into a shared helper and run it on the initial load (initializeFlow) as well as after a submission (handleSubmit), so the flow redirects to the callback instead of hanging.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1c644d0 to
b073a63
Compare
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.
Purpose
Fix the login gate hanging on a perpetual loading spinner when an authentication flow completes on its very first /flow/execute step — i.e. when the backend returns flowStatus: COMPLETE immediately, before any UI components are rendered (for example, when a reused browser SSO session lets the flow finish without a credential prompt).
In v2 SignIn, terminal flow statuses (Complete / Error) were handled only in the submission path (handleSubmit), not on the initial flow load (initializeFlow). On an initial COMPLETE response there are no components to render, so the initialize path fell through and the UI stayed on CircularProgress forever instead of redirecting to the callback.
This is a general client-side correctness fix: any flow that completes (or errors) on its first step is now finished properly. It is self-contained — no dependency on any backend feature, and no behavior change for existing flows that begin with a prompt (the new branch simply isn't hit until a flow returns COMPLETE on the first step).
Approach
Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks