Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shamique/3cd87d93cddf3293cc9ee882d8c650da to your computer and use it in GitHub Desktop.
Save shamique/3cd87d93cddf3293cc9ee882d8c650da to your computer and use it in GitHub Desktop.
confirmUser(verificationCode, userName) {
return new Promise((resolved, reject) => {
const userPool = new AWSCognito.CognitoUserPool(this._POOL_DATA);
const cognitoUser = new AWSCognito.CognitoUser({
Username: userName,
Pool: userPool
});
cognitoUser.confirmRegistration(verificationCode, true, function(err, result) {
if (err) {
reject(err);
} else {
resolved(result);
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment