diff --git a/public/js/dashboard.js b/public/js/dashboard.js index 76b8ec4..7309908 100644 --- a/public/js/dashboard.js +++ b/public/js/dashboard.js @@ -559,6 +559,10 @@ panel.changePassword = function(){

+

+ +

+ Set new password

`; @@ -566,9 +570,18 @@ panel.changePassword = function(){ panel.page.appendChild(container); document.getElementById('sendChangePassword').addEventListener('click', function(){ - panel.sendNewPassword(document.getElementById('password').value); + if (document.getElementById('password').value === document.getElementById('passwordConfirm').value) { + panel.sendNewPassword(document.getElementById('password').value); + } else { + swal({ + title: "Password mismatch!", + text: 'Your passwords do not match, please try again.', + type: "error" + }, function() { + panel.changePassword(); + }); + } }); - } panel.sendNewPassword = function(pass){