Skip to content

Commit 92fba5d

Browse files
authored
fix(clerk-react): Correct dependency array in useAuth (#7165)
1 parent f0c3a55 commit 92fba5d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/shiny-taxis-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-react': patch
3+
---
4+
5+
Add sessionClaims to the useCallback dependency array which creates derivedHas in useAuth()

packages/react/src/hooks/useAuth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export function useDerivedAuth(
171171
plans: ((sessionClaims as JwtPayload | undefined)?.pla as string) || '',
172172
})(params);
173173
},
174-
[has, userId, orgId, orgRole, orgPermissions, factorVerificationAge],
174+
[has, userId, orgId, orgRole, orgPermissions, factorVerificationAge, sessionClaims],
175175
);
176176

177177
const payload = resolveAuthState({

0 commit comments

Comments
 (0)