Created
June 5, 2018 17:12
-
-
Save prasadjay/0dd686f1612e28338ce509b00dc3a448 to your computer and use it in GitHub Desktop.
Delete-Attributes-Cognito
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
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