-
Notifications
You must be signed in to change notification settings - Fork 408
fix(backend): Add more error reasons for refresh token query param #4193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(backend): Add more error reasons for refresh token query param #4193
Conversation
🦋 Changeset detectedLatest commit: e9007ed The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 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 |
|
!snapshot |
|
Hey @anagstef - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@1.3.7-snapshot.v150a390 --save-exact
npm i @clerk/backend@1.13.3-snapshot.v150a390 --save-exact
npm i @clerk/chrome-extension@1.3.9-snapshot.v150a390 --save-exact
npm i @clerk/clerk-js@5.22.4-snapshot.v150a390 --save-exact
npm i @clerk/elements@0.15.5-snapshot.v150a390 --save-exact
npm i @clerk/clerk-expo@2.2.15-snapshot.v150a390 --save-exact
npm i @clerk/express@0.1.4-snapshot.v150a390 --save-exact
npm i @clerk/fastify@1.0.46-snapshot.v150a390 --save-exact
npm i @clerk/localizations@3.0.5-snapshot.v150a390 --save-exact
npm i @clerk/nextjs@5.6.1-snapshot.v150a390 --save-exact
npm i @clerk/clerk-react@5.9.2-snapshot.v150a390 --save-exact
npm i @clerk/remix@4.2.30-snapshot.v150a390 --save-exact
npm i @clerk/clerk-sdk-node@5.0.43-snapshot.v150a390 --save-exact
npm i @clerk/shared@2.8.2-snapshot.v150a390 --save-exact
npm i @clerk/tanstack-start@0.4.6-snapshot.v150a390 --save-exact
npm i @clerk/testing@1.3.4-snapshot.v150a390 --save-exact
npm i @clerk/themes@2.1.31-snapshot.v150a390 --save-exact
npm i @clerk/types@4.21.1-snapshot.v150a390 --save-exact |
| // To perform a token refresh, apiClient must be defined. | ||
| assertApiClient(options.apiClient); | ||
| } catch (err: any) { | ||
| throw { errors: [{ code: RefreshTokenErrorReason.MissingApiClient, message: err?.message || '' }] }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the mix between single error and errors array? I've only seen single errors, not multiple, in your code below 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LekoArts an errors array is returned on API errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just refactored this, to be clearer.
|
!snapshot |
|
Hey @anagstef - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@1.3.7-snapshot.v51c436a --save-exact
npm i @clerk/backend@1.13.3-snapshot.v51c436a --save-exact
npm i @clerk/chrome-extension@1.3.9-snapshot.v51c436a --save-exact
npm i @clerk/clerk-js@5.22.4-snapshot.v51c436a --save-exact
npm i @clerk/elements@0.15.5-snapshot.v51c436a --save-exact
npm i @clerk/clerk-expo@2.2.15-snapshot.v51c436a --save-exact
npm i @clerk/express@0.1.4-snapshot.v51c436a --save-exact
npm i @clerk/fastify@1.0.46-snapshot.v51c436a --save-exact
npm i @clerk/localizations@3.0.5-snapshot.v51c436a --save-exact
npm i @clerk/nextjs@5.6.1-snapshot.v51c436a --save-exact
npm i @clerk/clerk-react@5.9.2-snapshot.v51c436a --save-exact
npm i @clerk/remix@4.2.30-snapshot.v51c436a --save-exact
npm i @clerk/clerk-sdk-node@5.0.43-snapshot.v51c436a --save-exact
npm i @clerk/shared@2.8.2-snapshot.v51c436a --save-exact
npm i @clerk/tanstack-start@0.4.6-snapshot.v51c436a --save-exact
npm i @clerk/testing@1.3.4-snapshot.v51c436a --save-exact
npm i @clerk/themes@2.1.31-snapshot.v51c436a --save-exact
npm i @clerk/types@4.21.1-snapshot.v51c436a --save-exact |
|
!snapshot |
|
Hey @anagstef - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@1.3.7-snapshot.ve9007ed --save-exact
npm i @clerk/backend@1.13.3-snapshot.ve9007ed --save-exact
npm i @clerk/chrome-extension@1.3.9-snapshot.ve9007ed --save-exact
npm i @clerk/clerk-js@5.22.4-snapshot.ve9007ed --save-exact
npm i @clerk/elements@0.15.5-snapshot.ve9007ed --save-exact
npm i @clerk/clerk-expo@2.2.15-snapshot.ve9007ed --save-exact
npm i @clerk/express@0.1.4-snapshot.ve9007ed --save-exact
npm i @clerk/fastify@1.0.46-snapshot.ve9007ed --save-exact
npm i @clerk/localizations@3.0.5-snapshot.ve9007ed --save-exact
npm i @clerk/nextjs@5.6.1-snapshot.ve9007ed --save-exact
npm i @clerk/clerk-react@5.9.2-snapshot.ve9007ed --save-exact
npm i @clerk/remix@4.2.30-snapshot.ve9007ed --save-exact
npm i @clerk/clerk-sdk-node@5.0.43-snapshot.ve9007ed --save-exact
npm i @clerk/shared@2.8.2-snapshot.ve9007ed --save-exact
npm i @clerk/tanstack-start@0.4.6-snapshot.ve9007ed --save-exact
npm i @clerk/testing@1.3.4-snapshot.ve9007ed --save-exact
npm i @clerk/themes@2.1.31-snapshot.ve9007ed --save-exact
npm i @clerk/types@4.21.1-snapshot.ve9007ed --save-exact |
Description
This PR extracts more error reasons to be set on
__clerk_refreshquery param, instead of falling back tounexpected-refresh-error.New error codes are:
missing-api-clientmissing-session-tokenmissing-refresh-tokensession-token-decode-failedfetch-network-errorChecklist
npm testruns as expected.npm run buildruns as expected.Type of change