0
我試圖建立一個基於cognito用戶池中的用戶管理。 我使用nodesjs + express作爲後端,所有對cognito的操作都將從nodejs完成。cognito池 - 未能上申請一個用戶
我的註冊路線
app.post('/signup', (req, res) => {
let userName = req.body.userName;
let email = req.body.email;
let familyName = req.body.familyName;
let password = req.body.password;
let attributeList = [];
let dataEmail = {
Name: 'email',
Value: email
};
let name = {
Name: 'name',
Value: userName
};
let familyname = {
Name: 'family_name',
Value: familyName
};
let attributeEmail = new AmazonCognitoIdentity.CognitoUserAttribute(dataEmail);
let attributeName = new AmazonCognitoIdentity.CognitoUserAttribute(name);
let attributeFamilyName = new AmazonCognitoIdentity.CognitoUserAttribute(familyname);
attributeList.push(attributeEmail);
attributeList.push(attributeName);
attributeList.push(familyname);
let userPool = new CognitoUserPool(poolData);
userPool.signUp(email, password, attributeList, null, (err, result) => {
if (err) {
console.log(`got error during signup ${err}`);
res.sendStatus(500);
} else {
let cognitoUser = result.user;
console.log('user name is ' + cognitoUser.getUsername());
res.sendStatus(200);
}
});
});
但是我得到一個失敗,無法找到如何克服該 錯誤缺少參數:
了註冊MissingRequiredParameter過程中的錯誤:缺少所需的關鍵「 」在PARAMS