Closed ana0 closed 5 years ago
OK I figured out one way to add users to group:
You can set triggers on a Cognito Pool, so I set up one on user confirmation called userConfirm
which takes the user event from the Auth.confirmSignUp()
on the frontend and uses the deets to add the user to Cognito. Tested and working with the circles-remember-phone-test
cognito pool:
var params = {
GroupName: 'circles-basic-user-group',
UserPoolId: event.userPoolId,
Username: event.userName
};
return cognitoISP.adminAddUserToGroup(params, (err,data) => {
return data;
});
After redesiging my login flow with Ashoka's help - moving to the redux-saga paradigm - the lamda function is no longer working:
{code: "UserLambdaValidationException", name: "UserLambdaValidationException", message: "PostConfirmation failed with error Converting circular structure to JSON."}
code: "UserLambdaValidationException"
message: "PostConfirmation failed with error Converting circular structure to JSON."
name: "UserLambdaValidationException"
This SO Q seems to be talking about the same thing, but I am not sure what he means by 'data structure':
I am going to disable it for the moment, and come back as and when :/
Ok I fixed it. And set up CI/CD in the PR here: https://github.com/CirclesUBI/infrastructure-provisioning/pull/20
Can we close this and open a more specific one if we need @ana0 ?
Closing because done
Get some sense of access control in the api