javascript
javascript copied to clipboard
fix(clerk-react): Correct useAuth().isLoaded in transitive state
Description
When isomorphicClerk is loaded, we should return isLoaded: false from useAuth() when transitive state is set.
The check ensures we only override auth state with initial values when Clerk SDK hasn't loaded yet. Once loaded, we respect the actual auth state, even if it's transitioning, so components know to wait until session data is fully resolved.
Checklist
- [x]
pnpm testruns as expected. - [x]
pnpm buildruns as expected. - [ ] (If applicable) JSDoc comments have been added or updated for any package exports
- [ ] (If applicable) Documentation has been updated
Type of change
- [x] 🐛 Bug fix
- [ ] 🌟 New feature
- [ ] 🔨 Breaking change
- [ ] 📖 Refactoring / dependency upgrade / documentation
- [ ] other:
Summary by CodeRabbit
-
Bug Fixes
- Authentication hook now reports isLoaded = false when the auth system is in a transitive/loading state to avoid showing stale auth status.
-
Tests
- Added a test verifying the hook returns isLoaded = false and no session/user IDs while auth is transitive.
-
Chores
- Added release metadata for a patch version bump.