Repository navigation
Conversation
|
@pranav514 is attempting to deploy a commit to the Clerk Production Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: e1e78c2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@wobsoriano @thiskevinwang I have created the PR that resolves #1103, please do review it. Thank you |
Description
AuthenticateContextpreviously read the incoming request'sUser-Agentheader ontothis.userAgent, whilecreateAuthenticateRequest()did not forward the SDK's build-timeuserAgentoption. BecauseverifyMachineAuthToken()passesauthenticateContexttocreateBackendApiClient(), server-to-server verification requests (such asPOST /oauth_applications/access_tokens/verifyfor opaqueoat_tokens) sent the incoming client'sUser-Agentinstead of the SDK's configuredUser-Agent, which could result in upstream403rejections even whenclerkClient().idPOAuthAccessToken.verify()succeeded.This change:
AuthenticateContext.userAgentfrom the incomingUser-Agentrequest header and forwards the SDK's build-timeuserAgentthroughcreateAuthenticateRequest()(ignoring runtime overrides).m2m_token,oauth_token,api_key) inverifyMachineAuthToken()into a shared helper.401/404responses inhandleClerkAPIError()and exposes the HTTP status onunexpected-error-<status>auth reasons inhandleMachineError().Fixes #1103
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change