diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index d287a84..854acf6 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -353,56 +353,56 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic var split = url.split('?em:'); userInfo.emailId = split[1]; } - if (userInfo.newPassword != null) { if (userInfo.newPassword === userInfo.confirmPassword) { $rootScope.passwordMismatchMessage = null; - AuthenticationService.ResetUserPassword(userInfo) - .then( - function (result) { - if (result == LoginConstants.USER_NOT_FOUND) { - // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); - $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; - $("#messageModal").modal('show'); - - } - else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; - $("#messageModal").modal('show'); + AuthenticationService.ResetUserPassword(userInfo) + .then( + function (result) { + if (result == LoginConstants.USER_NOT_FOUND) { + // alert(LoginMessageConstants.USER_OR_PASSWORD_INCORRECT); + $rootScope.errorMessage = LoginMessageConstants.USER_OR_PASSWORD_INCORRECT; + $("#messageModal").modal('show'); - } - else { - //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { - if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) { - // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); - $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; + } + else if (result == LoginConstants.ERROR_IN_FECTHING_DETAILS) { + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); + $rootScope.errorMessage = LoginConstants.ERROR_IN_FECTHING_DETAILS; $("#messageModal").modal('show'); - $rootScope.isVisibleLogin = true; - $rootScope.isVisibleResetPass = false; - $location.url("/"); + } - } - }, - function (error) { - console.log(' Error in authentication = ' + error.statusText); - // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); - $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; - $("#messageModal").modal('show'); + else { + //if ((result.IsAcknowledged == true) && (result.IsModifiedCountAvailable == true)) { + if (result == LoginMessageConstants.PASSWORD_UPDATE_SUCCESS) { + // alert(LoginMessageConstants.PASSWORD_RESET_MESSAGE); + $rootScope.errorMessage = LoginMessageConstants.PASSWORD_RESET_MESSAGE; + $("#messageModal").modal('show'); + $rootScope.isVisibleLogin = true; + $rootScope.isVisibleResetPass = false; + $location.url("/"); + } + } + }, + function (error) { + console.log(' Error in authentication = ' + error.statusText); + // alert(LoginMessageConstants.ERROR_IN_FECTHING_DETAILS); + $rootScope.errorMessage = LoginMessageConstants.ERROR_IN_FECTHING_DETAILS; + $("#messageModal").modal('show'); - }); - } - else { - $rootScope.passwordMismatchMassage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; - //$("#messageModal").modal('show'); + }); + } + else { + $rootScope.errorMessage = LoginMessageConstants.NEW_AND_OLD_PASSWORD_DONOT_MATCH; + $("#messageModal").modal('show'); } } else { $rootScope.errorMessage = LoginMessageConstants.NEW_PASSWORD_FIELD_IS_EMPTY; $("#messageModal").modal('show'); } + } $rootScope.lexiconLanguageArray = []; diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 6f6a657..fc06809 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -1115,9 +1115,10 @@ - + The password is required. -

Password is too short.

+

Password length must be between 8 - 20 characters.

+

Password length must be between 8 - 20 characters.

@@ -1131,7 +1132,7 @@ Confirm password is required. - {{passwordMismatchMessage}} + {{passwordMismatchMessage}} @@ -1139,7 +1140,7 @@ - +