-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
I might be wrong but looks like when UsernameAttribute is set to "email" then AdminListGroupsForUser incorrectly returns an empty list for users that do have groups assigned.
This happens because users are added to groups as their sub:
cognito-local/src/services/userPoolService.ts
Line 398 in ed02db8
| groupMembers.add(user.Username); |
And the underlying AdminListGroupsForUser target function is matching member by the request Username which is expected to be user's email rather than sub:
| const usersGroups = groups.filter((x) => x.members?.includes(req.Username)); |
We're currently patching the AdminListGroupsForUser target to use user.Username and this hasn't been tested when UsernameAttribute is not set.
Metadata
Metadata
Assignees
Labels
No labels