From 0a31ebd2e52540f44ffa99bab57794ea1ac16ce7 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 15 Jul 2020 15:03:02 +0200 Subject: [PATCH] MOBILE-3485 login: Reset password input if password change forced --- src/core/login/pages/credentials/credentials.ts | 3 +++ src/core/login/pages/reconnect/reconnect.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/core/login/pages/credentials/credentials.ts b/src/core/login/pages/credentials/credentials.ts index 180aa315e..88d59bcb8 100644 --- a/src/core/login/pages/credentials/credentials.ts +++ b/src/core/login/pages/credentials/credentials.ts @@ -249,6 +249,9 @@ export class CoreLoginCredentialsPage { this.loginHelper.treatUserTokenError(siteUrl, error, username, password); if (error.loggedout) { this.navCtrl.setRoot('CoreLoginSitesPage'); + } else if (error.errorcode == 'forcepasswordchangenotice') { + // Reset password field. + this.credForm.controls.password.reset(); } }).finally(() => { modal.dismiss(); diff --git a/src/core/login/pages/reconnect/reconnect.ts b/src/core/login/pages/reconnect/reconnect.ts index 9b5a84f01..b9f56eeb6 100644 --- a/src/core/login/pages/reconnect/reconnect.ts +++ b/src/core/login/pages/reconnect/reconnect.ts @@ -221,6 +221,9 @@ export class CoreLoginReconnectPage { if (error.loggedout) { this.cancel(); + } else if (error.errorcode == 'forcepasswordchangenotice') { + // Reset password field. + this.credForm.controls.password.reset(); } }).finally(() => { modal.dismiss();