首页 文章

Cognito User AWS忘记密码步骤错误

提问于
浏览
0

我正在使用AngularJS上的Amazon WebService进行Cognito的用户管理 .

忘记密码步骤我有错误 .

我已经看过如何处理AWS git中给出的例子(https://github.com/aws/amazon-cognito-identity-js

但我总是在我的控制台上显示此消息: Error: callListeners emit emitEvent a [52]</d.prototype.runTo [52]</d.prototype.runTo/< a/< emitEvent/< callListeners emit emitEvent a [52]</d.prototype.runTo [52]</d.prototype.runTo/< a/< emitEvent/< callListeners f emit emitEvent a [52]</d.prototype.runTo [52]</d.prototype.runTo/< a/< emitEvent/< callListeners emit emitEvent a [52]</d.prototype.runTo [52]</d.prototype.runTo/< a/< emitEvent/< callListeners f c/< finishRequest handleRequest/<

我无法弄清楚为什么它不起作用:

这是我重置用户密码的方法:

AuthService.forgetPassword = function(username) {
            var userData = {
                Username : username,
                Pool : userPool
            };
            cognitoUser = new AWSCognito.CognitoIdentityServiceProvider.CognitoUser(userData);
            cognitoUser =
                cognitoUser.forgotPassword({
                   onSuccess: function (result) {
                       console.log('call result: ' + result);
                   },
                   onFailure: function(err) {
                        alert(err);
                   },
                   inputVerificationCode() {
                     var verificationCode = prompt('Please input verification code ' ,'');
                     var newPassword = prompt('Enter new password ' ,'');               
               cognitoUser.confirmPassword(verificationCode, newPassword, this);
                    }
               });
            };

请注意, verificationCodenewPassword getted设置得很好 . 有谁知道怎么办?

1 回答

相关问题