Skip to content

fix: handle 401 in typescript getFlow helpers#479

Open
jonas-jonas wants to merge 1 commit into
masterfrom
jonas-jonas/handle401Settings
Open

fix: handle 401 in typescript getFlow helpers#479
jonas-jonas wants to merge 1 commit into
masterfrom
jonas-jonas/handle401Settings

Conversation

@jonas-jonas

@jonas-jonas jonas-jonas commented Jul 13, 2026

Copy link
Copy Markdown
Member

Related Issue or Design Document

Checklist

  • I have read the contributing guidelines
    and signed the CLA.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got approval (please contact
    security@ory.com) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added the necessary documentation within the code base (if
    appropriate).

Further comments

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of unauthorized responses during settings flows.
    • Automatically restarts the flow when an authentication session expires in settings.
    • Preserves existing error handling for unauthorized responses in other flows.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f4d5619c-e5d9-49a8-a655-5123d6f0028b

📥 Commits

Reviewing files that changed from the base of the PR and between 566140f and 35274e0.

📒 Files selected for processing (1)
  • contrib/fetch/src/utils.ts

📝 Walkthrough

Walkthrough

handleFlowError now accepts an optional flowType and restarts settings flows on HTTP 401 responses while preserving existing handling for other flow types.

Changes

Settings flow error handling

Layer / File(s) Summary
Flow-type-aware 401 handling
contrib/fetch/src/utils.ts
Adds the FlowType import, extends FlowErrorHandlerProps with flowType, and invokes onRestartFlow() for settings-flow HTTP 401 responses.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: aeneasr

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is just the unfilled template and lacks the required summary, issue reference, checklist details, and comments. Fill in the big-picture summary, related issue or bug reproduction, checklist items, and any relevant notes or breaking-change details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: handling HTTP 401 in getFlow helpers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jonas-jonas/handle401Settings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant