Skip to content

Commit

Permalink
fix(clerk-react): Using wrong OrganizationCustomPermission type (#2310
Browse files Browse the repository at this point in the history
)
  • Loading branch information
panteliselef authored Dec 11, 2023
1 parent 6db2ad1 commit 3abb91f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .changeset/old-timers-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
4 changes: 2 additions & 2 deletions packages/react/src/contexts/AuthContext.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContextAndHook } from '@clerk/shared/react';
import type { ActJWTClaim, MembershipRole, OrganizationCustomPermission } from '@clerk/types';
import type { ActJWTClaim, MembershipRole, OrganizationCustomPermissionKey } from '@clerk/types';

export const [AuthContext, useAuthContext] = createContextAndHook<{
userId: string | null | undefined;
Expand All @@ -8,5 +8,5 @@ export const [AuthContext, useAuthContext] = createContextAndHook<{
orgId: string | null | undefined;
orgRole: MembershipRole | null | undefined;
orgSlug: string | null | undefined;
orgPermissions: OrganizationCustomPermission[] | null | undefined;
orgPermissions: OrganizationCustomPermissionKey[] | null | undefined;
}>('AuthContext');
4 changes: 2 additions & 2 deletions packages/react/src/utils/deriveState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
ActiveSessionResource,
InitialState,
MembershipRole,
OrganizationCustomPermission,
OrganizationCustomPermissionKey,
OrganizationResource,
Resources,
UserResource,
Expand All @@ -23,7 +23,7 @@ const deriveFromSsrInitialState = (initialState: InitialState) => {
const organization = initialState.organization as OrganizationResource;
const orgId = initialState.orgId;
const orgRole = initialState.orgRole as MembershipRole;
const orgPermissions = initialState.orgPermissions as OrganizationCustomPermission[];
const orgPermissions = initialState.orgPermissions as OrganizationCustomPermissionKey[];
const orgSlug = initialState.orgSlug;
const actor = initialState.actor;

Expand Down

0 comments on commit 3abb91f

Please sign in to comment.