Last active
June 7, 2017 21:22
-
-
Save matthieu-D/bed87d81ea229abe8f876ead3f030d13 to your computer and use it in GitHub Desktop.
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
register(username, password, attr) { | |
let attributes = []; | |
for (var x in attr) { | |
attributes.push(this.cognito.makeAttribute(x, attr[x])); | |
} | |
return new Promise((resolve, reject) => { | |
this.cognito.getUserPool().signUp(username, password, attributes, null, function(err, result) { | |
if (err) { | |
reject(err); | |
} else { | |
resolve(result.user); | |
} | |
}); | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment