【发布时间】:2021-12-20 22:46:17
【问题描述】:
我正在尝试使用 AWS Amplify 更新来自 AWS Cognito 用户池的用户的属性。
try {
const user = await Auth.currentAuthenticatedUser();
await Auth.updateUserAttributes(user, {
'nickname': 'newtestname'
});
} catch (error) {
console.log(error);
}
但我收到以下错误:
InvalidParameterException: user.nickname: Attribute cannot be updated.
我希望它是可更新的,因为我在我的 SAM 模板的 userpool-client 部分中使属性可写:
WriteAttributes:
- email
- nickname
UserPoolId: !Ref MyCognitoUserPool
我没有应用程序客户端密码,并且启用了所有身份验证流程。安全配置设置为启用。 用户可以注册,所以我假设客户端中的 Amplify 配置没问题。
这里有什么问题?
【问题讨论】:
标签: amazon-web-services amazon-cognito aws-amplify aws-userpools