Hi,
This code is reached when the user has the status FORCE_CHANGE_PASSWORD i.e. after a new user was created in cognito (by the admin in the aws-webconsole, with a temporary password, because signup is not allowed for example).
In my old code I resolved this with a call on cognitoUser
object:
cognitoUser.completeNewPasswordChallenge(this.new_password, {email}, ctx);
You initialized the CognitoUser object around line 166, but did not add it to the resolved promise - any chance to get access on this or any suggestions how to solve the initial FORCE_CHANGE_PASSWORD state of the user?
Thanks
Hi @defel , Thank you for pointing the issue out. We just made a fix, changed the resolve object. Here is the code snippet:
mfaRequired: (challengeName, challengeParam) => {
logger.debug('signIn MFA required');
user['challengeName'] = challengeName;
user['challengeParam'] = challengeParam;
resolve(user);
},
newPasswordRequired: (userAttributes, requiredAttributes) => {
logger.debug('signIn new password');
user['challengeName'] = 'NEW_PASSWORD_REQUIRED';
user['challengeParam'] = {
userAttributes: userAttributes,
requiredAttributes: requiredAttributes
};
resolve(user);
}
You'll need to hold this user object, collect new password, then call Auth.completeNewPassword(user, new_password, requiredAttributes) to complete the process.
Please pull the latest version. Let us know if any issues.
Thanks,
Richard
thank you richard for your fast response, this works perfectly.
Most helpful comment
Hi @defel , Thank you for pointing the issue out. We just made a fix, changed the resolve object. Here is the code snippet:
You'll need to hold this user object, collect new password, then call Auth.completeNewPassword(user, new_password, requiredAttributes) to complete the process.
Please pull the latest version. Let us know if any issues.
Thanks,
Richard