Added
Session Revalidation for React SDK
14 days ago by Jim Verducci
📣 Wristband React Client Auth SDK 3.2.0 Release 🎉
Release 3.2.0
New Features
✨ validateSession() Added to useWristbandAuth()
validateSession() Added to useWristbandAuth()The validateSession() function has been added to the useWristbandAuth() hook, allowing applications to manually re-fetch the authenticated user's session and update auth state without a full page reload.
Behavior:
- Sets
isLoadingtotrueduring the request - On success: Updates
userId,tenantId,metadata, and setsisAuthenticatedtotrue - On failure with
disableRedirectOnUnauthenticated: true: SetsauthErrorandisAuthenticatedtofalse - On failure with
disableRedirectOnUnauthenticated: false: Redirects to the login URL
Primary use cases:
- Popup-based OAuth login flows where the parent window needs to revalidate auth state after the popup closes
- Public pages with
disableRedirectOnUnauthenticated={true}that need to check if the user has since authenticated