Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce user method to leave an organization #1809

Conversation

chanioxaris
Copy link
Member

@chanioxaris chanioxaris commented Oct 2, 2023

Description

We introduce a new leaveOrganization() method on the User resource, which you can use in order to leave an organization as a user. We also replace the usage of the organization.removeMember() method with the new one we introduced in the component when a user chooses to leave the current organization

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Packages affected

  • @clerk/clerk-js
  • @clerk/clerk-react
  • @clerk/nextjs
  • @clerk/remix
  • @clerk/types
  • @clerk/themes
  • @clerk/localizations
  • @clerk/clerk-expo
  • @clerk/backend
  • @clerk/clerk-sdk-node
  • @clerk/shared
  • @clerk/fastify
  • @clerk/chrome-extension
  • gatsby-plugin-clerk
  • build/tooling/chore

Introduce a new leaveOrganization() method on the User resource, which you can
use in order to leave an organization as a user.
…rofile /> when leaving an org

We replace the usage of the old 'organization.removeMember()' method with
the new one we recently introduced, in the <OrgProfile /> component when
a user chooses to leave the current organization
@chanioxaris chanioxaris requested a review from a team as a code owner October 2, 2023 08:30
@changeset-bot
Copy link

changeset-bot bot commented Oct 2, 2023

🦋 Changeset detected

Latest commit: f91e3d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@clerk/clerk-js Minor
@clerk/types Minor
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/backend Patch
@clerk/fastify Patch
gatsby-plugin-clerk Patch
@clerk/localizations Patch
@clerk/nextjs Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/clerk-sdk-node Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dimkl
Copy link
Contributor

dimkl commented Oct 2, 2023

@chanioxaris will the organization.removeMember() be deprecated?

Copy link
Member

@nikosdouvlis nikosdouvlis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@chanioxaris
Copy link
Member Author

@chanioxaris will the organization.removeMember() be deprecated?

No we will keep both as are needed

  • organization.removeMember() should be used in an organization context with a user having the proper role to be able to remove a member
  • user.leaveOrganization() should be used in a user context, for leaving an organization which is already part of

@chanioxaris chanioxaris added this pull request to the merge queue Oct 2, 2023
@chanioxaris chanioxaris removed this pull request from the merge queue due to a manual request Oct 2, 2023
@chanioxaris chanioxaris added this pull request to the merge queue Oct 3, 2023
Merged via the queue into main with commit 33e927c Oct 3, 2023
6 checks passed
@chanioxaris chanioxaris deleted the haris/org-224-introduce-delete-v1meorganization_membershipsorganizationid branch October 3, 2023 06:53
@clerk-cookie clerk-cookie mentioned this pull request Oct 3, 2023
@AlonMiz
Copy link

AlonMiz commented Dec 2, 2023

really hard to understand what id should be used in the params
EDIT:
it was member.publicUserData.userId under OrganizationMembershipResource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants