I am working on Amplify + React fullstack app and have created complete Authentication flow. I want to authorize users based on their roles i.e. admin, superadmin, user, etc. When I sign up a new user, I am seeing the details in AWS Cognito but I am not able to figure out the roles for the user. I have two solutions in mind.
- Add a userType custom attribute in User table in AWS Cognito.
- Create three different groups in the pool and handle them manually.
I want to know which solution is better. I am unable to find any help online so it would be great if the detailed steps are shared. Thanks in advance.