diff options
| author | Kanacchi <[email protected]> | 2017-03-17 06:17:40 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-03-17 06:17:40 +0200 |
| commit | e3c95cb27d9a21e50f41504436af67b83a1d7194 (patch) | |
| tree | 93975f5348ba94a1515904c3d66bdb03732cb6bf /public | |
| parent | Merge pull request #16 from alucard0134/patch-1 (diff) | |
| parent | Update dashboard.js (diff) | |
| download | host.fuwn.me-e3c95cb27d9a21e50f41504436af67b83a1d7194.tar.xz host.fuwn.me-e3c95cb27d9a21e50f41504436af67b83a1d7194.zip | |
Merge pull request #20 from RyoshiKayo/patch-1
Password verification.
Diffstat (limited to 'public')
| -rw-r--r-- | public/js/dashboard.js | 17 |
1 files changed, 15 insertions, 2 deletions
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(){ <label class="label">New password:</label> <p class="control has-addons"> <input id="password" class="input is-expanded" type="password" placeholder="Your new password"> + </p> + <label class="label">Confirm password:</label> + <p class="control has-addons"> + <input id="passwordConfirm" class="input is-expanded" type="password" placeholder="Verify your new password"> <a id="sendChangePassword" class="button is-primary">Set new password</a> </p> `; @@ -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){ |