@annalib/anna-cognito-lib 2.2.25 → 2.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -290,8 +290,13 @@ class AnnaLibAuthService {
290
290
  }
291
291
  async verifyCode(confirmationCode, newPassword) {
292
292
  try {
293
- confirmResetPassword({ username: this.consumingProjectAuthService.userName, newPassword: newPassword, confirmationCode: confirmationCode });
294
- await this.expiryAllExistingCurrentSession(this.consumingProjectAuthService.userName, newPassword);
293
+ confirmResetPassword({ username: this.consumingProjectAuthService.userName, newPassword: newPassword, confirmationCode: confirmationCode }).then((response) => {
294
+ this.expiryAllExistingCurrentSession(this.consumingProjectAuthService.userName, newPassword);
295
+ }, (err) => {
296
+ console.log(err);
297
+ this.noOfAttempts = this.noOfAttempts + 1;
298
+ this.verifyAndSetNewPasswordErrorMessage = this.forgotPasswordError(err, this.noOfAttempts);
299
+ });
295
300
  }
296
301
  catch (err) {
297
302
  console.log(err);
@@ -304,7 +309,7 @@ class AnnaLibAuthService {
304
309
  }
305
310
  forgotPasswordError(err, noOfAttempts) {
306
311
  let errorMessage;
307
- switch (err.code) {
312
+ switch (err) {
308
313
  case "LimitExceededException":
309
314
  this.sessionLocked = true;
310
315
  errorMessage = LoginConstant.attemptLimitExceeded;