File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 11/node_modules
22/dist
3+ .idea
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export function AuthKitProvider(props: AuthKitProviderProps) {
4343 } = response ;
4444 const {
4545 role = null ,
46+ roles = null ,
4647 permissions = [ ] ,
4748 feature_flags : featureFlags = [ ] ,
4849 } = getClaims ( accessToken ) ;
@@ -52,6 +53,7 @@ export function AuthKitProvider(props: AuthKitProviderProps) {
5253 user,
5354 organizationId,
5455 role,
56+ roles,
5557 permissions,
5658 featureFlags,
5759 impersonator,
@@ -117,6 +119,7 @@ function isEquivalentWorkOSSession(
117119 a . user ?. updatedAt === b . user ?. updatedAt &&
118120 a . organizationId === b . organizationId &&
119121 a . role === b . role &&
122+ a . roles === b . roles &&
120123 a . permissions . length === b . permissions . length &&
121124 a . permissions . every ( ( perm , i ) => perm === b . permissions [ i ] ) &&
122125 a . featureFlags . length === b . featureFlags . length &&
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export interface State {
99 isLoading : boolean ;
1010 user : User | null ;
1111 role : string | null ;
12+ roles : string [ ] | null ;
1213 organizationId : string | null ;
1314 permissions : string [ ] ;
1415 featureFlags : string [ ] ;
@@ -19,6 +20,7 @@ export const initialState: State = {
1920 isLoading : true ,
2021 user : null ,
2122 role : null ,
23+ roles : null ,
2224 organizationId : null ,
2325 permissions : [ ] ,
2426 featureFlags : [ ] ,
You can’t perform that action at this time.
0 commit comments