Skip to content

Instantly share code, notes, and snippets.

@prasadjay
Created June 5, 2018 17:12
Show Gist options
  • Save prasadjay/0dd686f1612e28338ce509b00dc3a448 to your computer and use it in GitHub Desktop.
Save prasadjay/0dd686f1612e28338ce509b00dc3a448 to your computer and use it in GitHub Desktop.
Delete-Attributes-Cognito
function deleteAttributes(username, password){
var attributeList = [];
attributeList.push("custom:scope");
attributeList.push("name");
var authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails({
Username: username,
Password: password,
});
var userData = {
Username: username,
Pool: userPool
};
var cognitoUser = new AmazonCognitoIdentity.CognitoUser(userData);
cognitoUser.deleteAttributes(attributeList, (err, result) => {
if (err) {
//handle error
} else {
console.log(result);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment