1 Answer
- Newest
- Most votes
- Most comments
0
Cognito issue: Use the following package which uses the IAM credentials that the function has:
const cognito = new AWS.CognitoIdentityServiceProvider();
const readGroup = {
Description: `Read group for ${clientName}`,
GroupName: `Read-${clientAccountId}`,
Precedence: 2,
UserPoolId: userPoolId,
};
const newGroup: AWS.CognitoIdentityServiceProvider.CreateGroupResponse | undefined = await new Promise((resolve, reject) => {
return cognito.createGroup(readGroup, function (err, data) {
if (err) {
throw err;
} else {
resolve(data);
}
});
});
Graphql / DynamoDB issue: Add the JWT token from the request as a param of the create request:
const authToken = event.request.headers['authorization'] ?? '';
const user = {
userId: userId,
...
};
const { data: updatedUser, errors: userCreateErrors } = await client.models.User.create(
user,
{
authMode: 'identityPool',
authToken: authToken
}
);
answered a month ago
Relevant content
- Accepted Answerasked 2 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 3 months ago