Last active
March 15, 2020 15:19
-
-
Save geoseong/594789954a71b58ddf490c6e59bbaca7 to your computer and use it in GitHub Desktop.
The way to signup with KAKAO social provider using Amazon Cognito and AWS Amplify: step 05(Post Confirmation Cognito Lambda Trigger)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// amplify/backend/function/{amplify's auth Resource name}PostConfirmation/src/add-to-group.js | |
/* eslint-disable-line */ const aws = require('aws-sdk'); | |
exports.handler = async (event, context, callback) => { | |
const cognitoidentityserviceprovider = new aws.CognitoIdentityServiceProvider({ apiVersion: '2016-04-18' }); | |
const GroupName = event.request.clientMetadata.GroupName; | |
const addUserParams = { | |
GroupName, | |
UserPoolId: event.userPoolId, | |
Username: event.userName, | |
}; | |
try { | |
await cognitoidentityserviceprovider.adminAddUserToGroup(addUserParams).promise(); | |
callback(null, event); | |
} catch (e) { | |
callback(e); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment