You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8709ce8
Browse filesBrowse the repository at this point in the historyBrowse files
feat(nextjs): expose organization, isInitialized, clientId, signInOptions, switchOrganization and getDecodedIdToken in useAsgardeo()
The Next.js context lacked several fields the React SDK's context provides;
the bundled sample already read `organization` and got undefined.
- organization: the current organization from the server provider.
- isInitialized: true (the client provider is only rendered once the client
has been initialized), clientId and signInOptions from the configuration.
- switchOrganization(): the server action, followed by router.refresh() so
the server components pick up the switched session.
- getDecodedIdToken(): the ID token claims through a new server action; the
raw tokens stay in the HttpOnly cookie (hence no getAccessToken/getIdToken/
exchangeToken in the browser).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
`useAsgardeo()` exposes more of what the React SDK's context provides: `organization` (the current organization, which the bundled sample already reads), `isInitialized`, `clientId`, `signInOptions`, `switchOrganization()` (which re-renders the server components once the switch has happened) and `getDecodedIdToken()` (the ID token claims, resolved through a server action so the tokens themselves stay in the HttpOnly cookie).
0 commit comments