Back

.listMemberships does not return users names and emails

  • 0
  • Auth
  • Flutter
  • Cloud
Tomic R.
6 Feb, 2025, 16:57

Hi! I have the following code (dart/flutter):

TypeScript
 final response = await _teams.get(teamId: teamId);

final teamMembers = await _teams.listMemberships(teamId: teamId);

print(
  teamMembers.memberships
      .map((e) => '${e.userId} ${e.roles}, ${e.userName}, ${e.userEmail}')
      .toList(),
);

The problem is, that I get this output:

TypeScript
[64ce2bb01c703cca4dd7 [owner], , , 66b39729ab248549d5d0 [owner], , ]

So as you can see, the userName and userEmail are not being returned. It's from client side, the user is logged in (and is in the team I am referring to) and in appwrite console, each team member to the team I am referring to has a name and obviously also has an email.

TL;DR
Problem: .listMemberships does not return user names and emails. Solution: Ensure that the user authentication is correct and that the user is logged in on the client side. Check the permissions and data of team members in the appwrite console.
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