From 86baf8ca4bdfa006ca47d51ff67b33d9f602d36b Mon Sep 17 00:00:00 2001 From: Pavel Luhin <8158004+p-luhin@users.noreply.github.com> Date: Wed, 11 Apr 2018 13:34:09 +0300 Subject: [PATCH] Fix bug with change password (#16) * Fix several bugs with changing passwords * Increase pom version --- pom.xml | 2 +- .../modal/change-password/change-password.controller.js | 8 ++++++-- .../modal/change-password/change-password.service.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 72d1a33..67aee46 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ by.bsu.rfe sms-server - 1.3.5 + 1.3.6 war diff --git a/src/main/webapp/resources/sms-server/modal/change-password/change-password.controller.js b/src/main/webapp/resources/sms-server/modal/change-password/change-password.controller.js index 089c09c..db3db56 100644 --- a/src/main/webapp/resources/sms-server/modal/change-password/change-password.controller.js +++ b/src/main/webapp/resources/sms-server/modal/change-password/change-password.controller.js @@ -11,8 +11,12 @@ $scope.selected.credentials = {}; $scope.changePassword = function (oldPassword, newPassword, anotherNewPassword) { - if (!oldPassword || !newPassword || !anotherNewPassword || newPassword != anotherNewPassword) { - + if (!oldPassword || + !newPassword || + !anotherNewPassword || + newPassword !== anotherNewPassword || + newPassword === oldPassword + ) { toaster.pop({ type: 'error', title: 'Error', diff --git a/src/main/webapp/resources/sms-server/modal/change-password/change-password.service.js b/src/main/webapp/resources/sms-server/modal/change-password/change-password.service.js index a21d425..300d3a2 100644 --- a/src/main/webapp/resources/sms-server/modal/change-password/change-password.service.js +++ b/src/main/webapp/resources/sms-server/modal/change-password/change-password.service.js @@ -12,7 +12,7 @@ }; function changePassword(password) { - return $http.post(RestURLFactory.CHANGE_PASSWORD, passObj); + return $http.post(RestURLFactory.CHANGE_PASSWORD, password); } } })(); \ No newline at end of file