fix: address API resource server test report issues - #14
Merged
Conversation
yogeshchoudhary147
force-pushed
the
fix/api-bug-fixes
branch
from
August 24, 2026 05:47
a663a5e to
6a00dc5
Compare
…d of Error for correct HTTP status codes
…ce for PKCE vs M2M flows
yogeshchoudhary147
force-pushed
the
fix/api-bug-fixes
branch
from
August 24, 2026 05:48
6a00dc5 to
cd4c126
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.
Summary
requireClaimsandrequireClaimsFromContextnow throwResponseobjects (401/403 JSON) instead ofBearerTokenError/InsufficientScopeErrorError instances. React Router forwards thrownResponseobjects directly to the client as HTTP responses; thrownErrorinstances fall into the error boundary and produce a 500. Aligns behavior withrequireSession.requireClaims,getClaims,bearerTokenMiddleware, correct Auth0 Dashboard setup (PKCE user flows requireuser.policy: allow_allon the resource server — not the M2M Applications tab), andclaims.audstring vsstring[]handling.Test plan
requireClaimswith no Authorization header → 401 JSON{ error: "bearer_token_error" }requireClaimswith invalid token → 401 JSON with underlying error messagerequireClaimswith missing scope → 403 JSON{ error: "insufficient_scope" }requireClaimsFromContextwith null claims in context → 401 ResponserequireClaimsFromContextwith missing scope → 403 ResponseConfigurationError(missing AUTH0_DOMAIN/AUTH0_AUDIENCE) still propagates as-is (not swallowed)npm test