且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

本地存储缺少ID令牌,请在更改密码Cognito AWS时对错误进行身份验证

更新时间:2023-12-02 20:51:40

经过艰苦的努力,我发现每次使用

After so much of struggle, I figured out that I was creating new Cognito user every time using

poolData = {
    UserPoolId: "XXXXXXXXXXXXXXXXX",
    ClientId: "XXXXXXXXXXXXXXXXXXXXXXXX"
};
userPool: CognitoUserPool = new CognitoUserPool(this.poolData);

因此,每当我这样称呼时,都会创建一个新的认知用户.因此,对此的更改密码无效.

So, whenever I call this, a new cognito-user is created. So, change-password on this was not working.

当我创建一个通用函数来访问 cognitoUser 并在各处使用该函数时,对我来说是可行的.

When I created a common function to access cognitoUser and using the same everywhere worked for me.

谢谢...