Manage users in Cognito using admin actions
See original GitHub issueAdmin actions allows us to quickly generate an API for managing Cognito users and groups. The goal of this issue is to discuss how we could make react-admin-amplify communicate with that API.
The way I see it right now is:
- Define a resource name like
cognitoUsers
- Edit the data provider so when it sees that resource name is
cognitoUsers
, it calls the admin API instead of the GraphQL API. - Same thing with
cognitoGroups
From here, we can easily list users and groups and display one user and one group.
In order to avoid people to always look for available fields we could create 4 components:
CognitoUserList
CognitoUserShow
CognitoGroupList
CognitoGroupShow
and since there is no update or delete, we could create two resources: CognitoUserResource
and CognitoGroupResource
that are only implementing list
and show
.
That would be a good start. But we could go further 🙂
What would be nice is to also create something like react-admin ShowButton
, but the actions would be for each user:
confirmUserSignUp
disableUser
enableUser
other actions like addUserToGroup
are more complex because they require a form, so we will have to create a custom route that is displaying a form and manage this form submit. I did something similar in a project and could do this easily.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
I have completed the first part which was displaying users and groups: https://github.com/MrHertal/react-admin-amplify/releases/tag/v1.3.0
Hi @a93h
II will try to support this library as long as I can.
I don’t have time currently to add this feature. If you want to add it, I will be pleased to review your PR.