Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/two-candles-yawn.md
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 2 additions & 8 deletions packages/clerk-js/src/core/resources/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
}
Expand Down