Back

Update Membership status doesn't work correctly

  • 0
  • Auth
  • Web
Mittelblut9
31 Jul, 2024, 11:24

When I try to change a user's team with createMembership and updateMembershipStatus, the user is somehow in the new team, but appwrite doesn't show a second member in the list + when I try to add any security to a document with the given team (e.g. Read Access), the user doesn't have access to it.

Running on Nuxt btw.

newRole is the Teamname

TypeScript
this.$appwrite.teams.createMembership(
    newRole,
    [
        newRole, // Is this even necessary?
    ],
    undefined,
    userId,
    undefined,
    membershipUrl,
)
TypeScript
useAppwrite().teams.updateMembershipStatus(
  teamId,
  membershipId,
  userId,
  secret,
)

The appwrite call difference is because the create statement is on a page. And I handle the status update through a middleware :)

TL;DR
- Developers are facing issues with updating membership status and changing a user's team in Appwrite. - When trying to update the team, the user is not shown as a member in the list and loses access to security settings configured for the new team. - The code snippets provided show the usage of `createMembership` and `updateMembershipStatus` functions. - There seems to be an inconsistency in the way the create statement and status update are handled. - The issue is being faced in a Nuxt environment.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more