This code is a sample, but it would not really be used within cognitoUser.authenticateUser because the credentials were just created with new AWS.CognitoIdentityCredentials, it would not be necessary to refresh them, it is a code the .refresh method to say that this method exists, no?
AWS.config.credentials.refresh((error) => {
if (error) {
console.error(error);
} else {
// Instantiate aws sdk service objects now that the credentials have been updated.
// example: var s3 = new AWS.S3();
console.log('Successfully logged!');
}
});
This code is a sample, but it would not really be used within cognitoUser.authenticateUser because the credentials were just created with new AWS.CognitoIdentityCredentials, it would not be necessary to refresh them, it is a code the .refresh method to say that this method exists, no?