From fda308146b87ff6dec2babbbed8c85998344bc5a Mon Sep 17 00:00:00 2001 From: RyoshiKayo Date: Fri, 10 Mar 2017 08:26:05 -0800 Subject: [PATCH] Password verification. --- public/js/dashboard.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/public/js/dashboard.js b/public/js/dashboard.js index 76b8ec4..0818854 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('passwordTwo').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){