Last active
June 5, 2018 17:12
-
-
Save prasadjay/071e0c8225d2b37191ca7b08b34d965b to your computer and use it in GitHub Desktop.
Update-User-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 update(username, password){ | |
var attributeList = []; | |
attributeList.push(new AmazonCognitoIdentity.CognitoUserAttribute({ | |
Name: "custom:scope", | |
Value: "some new value" | |
})); | |
attributeList.push(new AmazonCognitoIdentity.CognitoUserAttribute({ | |
Name: "name", | |
Value: "some new value" | |
})); | |
var authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails({ | |
Username: username, | |
Password: password, | |
}); | |
var userData = { | |
Username: username, | |
Pool: userPool | |
}; | |
var cognitoUser = new AmazonCognitoIdentity.CognitoUser(userData); | |
cognitoUser.updateAttributes(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