Skip to content

fix(auth): rethrow errors in tokenRequestHandler instead of swallowing - #1435

Open
anikethinge wants to merge 1 commit into
RocketChat:developfrom
anikethinge:fix/rethrow-token-request-error
Open

anikethinge wants to merge 1 commit into
RocketChat:developfrom
anikethinge:fix/rethrow-token-request-error

Conversation

@anikethinge

Copy link
Copy Markdown

Summary

Rethrows caught errors in tokenRequestHandler after logging so failed secure token requests reject properly instead of silently resolving as undefined.

Acceptance Criteria fulfillment

  • Rethrow ApiError on non-2xx HTTP responses in tokenRequestHandler
  • Rethrow network/fetch failures so callers can handle auth/cookie errors properly
  • Verified build (@embeddedchat/auth) and promise rejection behavior across non-2xx and network failure cases

Fixes #1141

Video/Screenshots

N/A (internal auth helper error propagation fix)

PR Test Details

Verified locally against @embeddedchat/auth build output (dist/index.mjs):

  • Non-2xx /auth-token responses reject with ApiError
  • Network failures reject with the underlying error
  • 2xx responses continue resolving with parsed JSON

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
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.

Secure token request helper swallows API errors and hides auth/cookie failures

2 participants