Skip to content

fix(auth): return 401 for rejected Passport exchange codes (#1281) - #1367

Closed
hardik4love-lang wants to merge 1 commit into
ubiquity:developmentfrom
hardik4love-lang:fix/passport-exchange-401
Closed

hardik4love-lang wants to merge 1 commit into
ubiquity:developmentfrom
hardik4love-lang:fix/passport-exchange-401

Conversation

@hardik4love-lang

Copy link
Copy Markdown

Resolves #1281

Problem

When Passport returns a normal 4xx response for an expired or invalid authorization code, \�oundedJson\ previously converted every non-2xx response into \PassportError(502), causing the callback to report service unavailability instead of an authentication failure.

Solution

  • Check
    esponse.status >= 400 && response.status < 500\ immediately after the SSO exchange request and throw \PassportError(401).
  • Preserves 502 for upstream 5xx outages and clears state/verifier cookies on error.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 900dc31e-e07e-4085-a7a5-a02a30f1e69d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@ubiquity-os ubiquity-os Bot closed this Nov 13, 2026
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.

Return 401 for rejected Passport exchange codes

1 participant