fix(backend): Fix getToken returning null when resolving the handshake payload - #3764
Conversation
🦋 Changeset detectedLatest commit: cbde650 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.0.1-snapshot.v7ada807 --save-exact
npm i @clerk/backend@1.4.0-snapshot.v7ada807 --save-exact
npm i @clerk/chrome-extension@1.1.5-snapshot.v7ada807 --save-exact
npm i @clerk/clerk-js@5.10.0-snapshot.v7ada807 --save-exact
npm i @clerk/elements@0.10.5-snapshot.v7ada807 --save-exact
npm i @clerk/clerk-expo@1.2.8-snapshot.v7ada807 --save-exact
npm i @clerk/express@0.0.18-snapshot.v7ada807 --save-exact
npm i @clerk/fastify@1.0.20-snapshot.v7ada807 --save-exact
npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact
npm i @clerk/nextjs@5.2.5-snapshot.v7ada807 --save-exact
npm i @clerk/clerk-react@5.2.9-snapshot.v7ada807 --save-exact
npm i @clerk/remix@4.2.4-snapshot.v7ada807 --save-exact
npm i @clerk/clerk-sdk-node@5.0.17-snapshot.v7ada807 --save-exact
npm i @clerk/shared@2.4.0-snapshot.v7ada807 --save-exact
npm i @clerk/tanstack-start@0.1.8-snapshot.v7ada807 --save-exact
npm i @clerk/testing@1.1.12-snapshot.v7ada807 --save-exact |
7ada807 to
94b1fb2
Compare
|
!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.0.1-snapshot.v94b1fb2 --save-exact
npm i @clerk/backend@1.4.0-snapshot.v94b1fb2 --save-exact
npm i @clerk/chrome-extension@1.1.5-snapshot.v94b1fb2 --save-exact
npm i @clerk/clerk-js@5.10.0-snapshot.v94b1fb2 --save-exact
npm i @clerk/elements@0.10.5-snapshot.v94b1fb2 --save-exact
npm i @clerk/clerk-expo@1.2.8-snapshot.v94b1fb2 --save-exact
npm i @clerk/express@0.0.18-snapshot.v94b1fb2 --save-exact
npm i @clerk/fastify@1.0.20-snapshot.v94b1fb2 --save-exact
npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact
npm i @clerk/localizations@2.5.0-snapshot.v94b1fb2 --save-exact
npm i @clerk/nextjs@5.2.5-snapshot.v94b1fb2 --save-exact
npm i @clerk/clerk-react@5.2.9-snapshot.v94b1fb2 --save-exact
npm i @clerk/remix@4.2.4-snapshot.v94b1fb2 --save-exact
npm i @clerk/clerk-sdk-node@5.0.17-snapshot.v94b1fb2 --save-exact
npm i @clerk/shared@2.4.0-snapshot.v94b1fb2 --save-exact
npm i @clerk/tanstack-start@0.1.8-snapshot.v94b1fb2 --save-exact
npm i @clerk/testing@1.2.0-snapshot.v94b1fb2 --save-exact
npm i @clerk/themes@2.1.13-snapshot.v94b1fb2 --save-exact
npm i @clerk/types@4.9.0-snapshot.v94b1fb2 --save-exact |
94b1fb2 to
d7dc9e1
Compare
|
!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.0.2-snapshot.vcbde650 --save-exact
npm i @clerk/backend@1.4.1-snapshot.vcbde650 --save-exact
npm i @clerk/chrome-extension@1.1.6-snapshot.vcbde650 --save-exact
npm i @clerk/clerk-js@5.10.1-snapshot.vcbde650 --save-exact
npm i @clerk/clerk-expo@1.2.9-snapshot.vcbde650 --save-exact
npm i @clerk/express@0.0.19-snapshot.vcbde650 --save-exact
npm i @clerk/fastify@1.0.21-snapshot.vcbde650 --save-exact
npm i gatsby-plugin-clerk@5.0.0-beta.45 --save-exact
npm i @clerk/localizations@2.5.1-snapshot.vcbde650 --save-exact
npm i @clerk/nextjs@5.2.6-snapshot.vcbde650 --save-exact
npm i @clerk/remix@4.2.5-snapshot.vcbde650 --save-exact
npm i @clerk/clerk-sdk-node@5.0.18-snapshot.vcbde650 --save-exact
npm i @clerk/tanstack-start@0.1.9-snapshot.vcbde650 --save-exact
npm i @clerk/testing@1.2.1-snapshot.vcbde650 --save-exact |
nikosdouvlis
left a comment
There was a problem hiding this comment.
This makes sense to me 👍🏻
…shake payload (#3764) This PR fixes an issue on Remix where getToken() returns no token when redirecting back when sign-in and handshake are triggered. The issue exists because the getToken() is getting the session token from the request cookie, but when returning from an external sign-in page (e.g. OAuth or Account Portal) on the request there is still the __clerk_handshake cookie, because it's not yet resolved. The issue exists only on production, and also does not happen to nextjs, because middleware has already resolved the handshake. With this PR we pass the session token that exists inside the handshake payload to be returned when calling getToken().
Description
This PR fixes an issue on Remix where
getToken()returns no token when redirecting back when sign-in and handshake are triggered.The issue exists because the
getToken()is getting the session token from the request cookie, but when returning from an external sign-in page (e.g. OAuth or Account Portal) on the request there is still the__clerk_handshakecookie, because it's not yet resolved. The issue exists only on production, and also does not happen to nextjs, because middleware has already resolved the handshake.With this PR we pass the session token that exists inside the handshake payload to be returned when calling
getToken().Checklist
npm testruns as expected.npm run buildruns as expected.Type of change