diff --git a/.changeset/two-candles-yawn.md b/.changeset/two-candles-yawn.md new file mode 100644 index 00000000000..059354f9066 --- /dev/null +++ b/.changeset/two-candles-yawn.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Reverts the changes introduced in [PR #7105](https://github.com/clerk/javascript/pull/7105), as it was causing JWTs returned from client piggybacking not to be inserted into the cache even though their claims had actually changed. diff --git a/packages/clerk-js/src/core/resources/Session.ts b/packages/clerk-js/src/core/resources/Session.ts index 7ac829ca520..ee5df2c43a1 100644 --- a/packages/clerk-js/src/core/resources/Session.ts +++ b/packages/clerk-js/src/core/resources/Session.ts @@ -131,15 +131,9 @@ export class Session extends BaseResource implements SessionResource { }; #hydrateCache = (token: TokenResource | null) => { - if (!token) { - return; - } - - const tokenId = this.#getCacheId(); - const existing = SessionTokenCache.get({ tokenId }); - if (!existing) { + if (token) { SessionTokenCache.set({ - tokenId, + tokenId: this.#getCacheId(), tokenResolver: Promise.resolve(token), }); }