-
Notifications
You must be signed in to change notification settings - Fork 402
feat(clerk-js,clerk-react): Introduce sessionClaims in useAuth()
#5565
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
feat(clerk-js,clerk-react): Introduce sessionClaims in useAuth()
#5565
Conversation
🦋 Changeset detectedLatest commit: d4f8868 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
917b511 to
1670fd0
Compare
sessionClaims in useAuth()
…auth-return # Conflicts: # packages/clerk-js/bundlewatch.config.json
| if (token.jwt) { | ||
| this.lastActiveToken = token; | ||
| // Emits the updated session with the new token to the state listeners | ||
| eventBus.dispatch(events.SessionTokenResolved, null); | ||
| } |
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.
For reviewers:
useAuth() and useSession() were not re-rendering when the poller would generate a new token. This is necessary in order for useAuth().sessionClaims and useSession().lastActiveToken.jwt to have the correct content always, without waiting on client piggybacking.
Signed-off-by: panteliselef <panteliselef@outlook.com>
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.
LGTM
…auth-return # Conflicts: # packages/clerk-js/bundlewatch.config.json # packages/clerk-js/src/core/resources/Session.ts
Description
Original PR
This PR acts as a ground work for
useAuth().sessionClaimslastActiveTokeneach time/tokenresolves successfullyChecklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change