-
-
Save yasudacloud/d96cfc14936db89924b2ecc2b25d0df3 to your computer and use it in GitHub Desktop.
controllers/cognito-controller.js
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
'use strict'; | |
const { | |
CognitoIdentityProviderClient, | |
ListUsersCommand | |
} = require("@aws-sdk/client-cognito-identity-provider"); | |
module.exports = ({strapi}) => ({ | |
async index(ctx) { | |
const {userPoolId, region} = strapi.config.get('plugin.strapi-plugin-user-pools') | |
const client = new CognitoIdentityProviderClient({region}); | |
const command = new ListUsersCommand({ | |
UserPoolId: userPoolId | |
}); | |
const {Users, PaginationToken} = await client.send(command); | |
ctx.body = {Users, PaginationToken} | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment