Skip to content
Back

How to use the session created from teams updateMembershipStatus?

  • 0
  • Web
  • Cloud
RLLLUP
29 Mar, 2025, 02:24
TypeScript
        // Create a temporary client for the invitation
        const tempClient = new Client()
        .setEndpoint(process.env.NEXT_PUBLIC_APPWRITE_ENDPOINT!)
        .setProject(process.env.NEXT_PUBLIC_APPWRITE_PROJECT!);
        
        // Update membership status for the new team member
        const tempTeams = new Teams(tempClient);
        const membership = await tempTeams.updateMembershipStatus(
          teamId,
          membershipId,
          userId,
          secret
        );

        // TODO: I would like to update the member name and password like below:
        const tempAccount = new Account(tempClient);
        
        await tempAccount.updateName(fullName);
        await tempAccount.updatePassword(password);
TL;DR
Create a session from teams updateMembershipStatus. Use the tempClient to update member name and password by creating a new Account.
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