问题
From the AWS Cognito documents:
https://aws.amazon.com/blogs/mobile/accessing-your-user-pools-using-the-amazon-cognito-identity-sdk-for-javascript/
AWSCognito.config.region = 'us-east-1';
var poolData = {
UserPoolId : '...', // your user pool id here
ClientId : '...' // your client id here
};
var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);
var userData = {
Username : '...', // your username here
Pool : userPool
};
However I do not know which file / where / when to create my instance of the userPool.
It makes sense for me to do it in the app.component.ts, but I am unsure if this is right.
I also don't understand where I import the AWSCognito
function from, I cannot find the right library to do this.
Thank you for any help.
来源:https://stackoverflow.com/questions/60101611/where-to-create-aws-cognitouserpool-in-an-angular-8-application