J a v a S c r i p t Ͱ ձ һ ొ Λ ࣮ ͢ Δ
h t t p s : / / g i t h u b . c o m / a w s / a m a z o n - c o g n i t o - i d e n t i t y - j s # u s a g e
var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);
var dataEmail = {Name : 'email',Value : '
[email protected]'};
var dataPhoneNumber = {Name : 'phone_number',Value : ‘+15555555555'};
var attributeEmail = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserAttribute(dataEmail);
var attributePhoneNumber = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserAttribute(dataPhoneNumber);
attributeList.push(attributeEmail);
attributeList.push(attributePhoneNumber);
userPool.signUp('username', 'password', attributeList, null, function(err, result){
if (err) { alert(err); return;}
cognitoUser = result.user;
console.log('user name is ' + cognitoUser.getUsername());
});