Skip to content

Commit 1db3881

Browse files
authored
fix(clerk-js): "You must belong to an organization" screen showing after accepting an invitation (#7921)
1 parent cd9e5f6 commit 1db3881

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.changeset/some-drinks-smash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Fix "You must belong to an organization" screen showing after accepting an organization invitation

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ const TaskChooseOrganizationInternal = () => {
2525
userSuggestions?.isLoading ||
2626
organizationCreationDefaults?.isLoading;
2727
const hasExistingResources = !!(userMemberships?.count || userInvitations?.count || userSuggestions?.count);
28-
const isOrganizationCreationDisabled = !isLoading && !user?.createOrganizationEnabled && !hasExistingResources;
28+
const isOrganizationCreationDisabled =
29+
!isLoading &&
30+
!user?.createOrganizationEnabled &&
31+
user?.organizationMemberships?.length === 0 &&
32+
!hasExistingResources;
2933

3034
if (isOrganizationCreationDisabled) {
3135
return <OrganizationCreationDisabledScreen />;

0 commit comments

Comments
 (0)