I want to store my users after they sign up in a mongodb database. I am using aws cognito. I found that you can create a lamda function that can run after "post confirmation". can anyone tell me how can I do that? from what I understand:
I am looking for solutions.
Your Lambda function will look like
const { MongoClient } = require('mongodb');
exports.handler = (event, context, callback) => {
// Get user attributes from the event
const email = event.request.userAttributes.email;
// Connect to MongoDB and save the user
// Return to Amazon Cognito
callback(null, event);
};
See: See: https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-post-confirmation.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.