lic*_*r93 2 variables session amazon-cognito angular
我的函数用于更新属性:
updateUserInfo(user, attributes) {
Auth.updateUserAttributes(user, attributes)
.then(
result => {
console.log(result); // SUCCESS
}
)
.catch(
error => {
console.log(error);
}
);
}
Run Code Online (Sandbox Code Playgroud)
结果是SUCCESS
,在我的 AWS Cognito 服务中,在特定用户的页面上,我可以看到属性已更改。所以更新在 Cognito 中运行良好。
但是,当我在调用此更新函数后刷新角度应用程序的页面时,旧属性仍然存在,而不是新属性。所以我认为需要刷新当前用户会话变量才能获取新属性,该怎么做?
注意:我不明白的是,在显示用户属性的角度应用程序的页面上,我向亚马逊发出 GET 请求以获取用户属性。因此,如果在获取这些信息之前已完成更新,为什么我仍然获得旧属性?
Auth.currentAuthenticatedUser({ bypassCache: true })
目前的解决方案是在之后调用Auth.updateUserAttributes()
。
归档时间: |
|
查看次数: |
1170 次 |
最近记录: |