Javascript attributeList.push()在cognito中不起作用
电子邮件(用户名)有效,但给定的姓名和姓氏无效。我想推送这个属性,这样我可以在cognito中看到它。我正在使用amazon-cognito-identity.js。我是否对attributeList.push()方法做了错误的处理Javascript attributeList.push()在cognito中不起作用,javascript,amazon-web-services,amazon-cognito,Javascript,Amazon Web Services,Amazon Cognito,电子邮件(用户名)有效,但给定的姓名和姓氏无效。我想推送这个属性,这样我可以在cognito中看到它。我正在使用amazon-cognito-identity.js。我是否对attributeList.push()方法做了错误的处理 哈哈,我真傻!我猜是错误还是我的打字错误。价值必须是“价值”而不是“价值”哈哈,我真傻!我猜是错误还是我的打字错误。值必须是“值”而不是“值” function registerButton() { var username = document.getEl
哈哈,我真傻!我猜是错误还是我的打字错误。价值必须是“价值”而不是“价值”哈哈,我真傻!我猜是错误还是我的打字错误。值必须是“值”而不是“值”
function registerButton() {
var username = document.getElementById('personalemail').value;
var given_name = document.getElementById('given_name').value;
var family_name = document.getElementById('family_name').value;
var password = document.getElementById('passwordInput').value;
//starts gathering info from cognito
var poolData = {
UserPoolId : _config.cognito.userPoolId,
ClientId : _config.cognito.clientId
}
var userPool = new AmazonCognitoIdentity.CognitoUserPool(poolData);
var attributeList = [];
var dataEmail = {
Name: 'email',
value: username
};
var dataFirstName = {
Name: 'given_name',
value: given_name
};
var dataLastName = {
Name: 'family_name',
value: family_name
};
var attributeEmail = new AmazonCognitoIdentity.CognitoUserAttribute(dataEmail);
var attributeFirstName = new AmazonCognitoIdentity.CognitoUserAttribute(dataFirstName);
var attributeLastName = new AmazonCognitoIdentity.CognitoUserAttribute(dataLastName);
attributeList.push(attributeEmail);
attributeList.push(attributeFirstName);
attributeList.push(attributeLastName);
userPool.signUp(username, password, attributeList, null, function(err, result){
if (err) {
alert(err.message || JSON.stringify(err));
return;
}
//location.replace("../register/subscriptionplans.html");
});
}