mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Clear password if decryption fails
This commit is contained in:
parent
0dbe4c0291
commit
9eb10fb21a
12
core/boot.js
12
core/boot.js
@ -299,8 +299,8 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
|
|||||||
var self = this;
|
var self = this;
|
||||||
form.addEventListener("submit",function(event) {
|
form.addEventListener("submit",function(event) {
|
||||||
// Collect the form data
|
// Collect the form data
|
||||||
var data = {};
|
var data = {},t;
|
||||||
for(var t=0; t<form.elements.length; t++) {
|
for(t=0; t<form.elements.length; t++) {
|
||||||
var e = form.elements[t];
|
var e = form.elements[t];
|
||||||
if(e.name && e.value) {
|
if(e.name && e.value) {
|
||||||
data[e.name] = e.value;
|
data[e.name] = e.value;
|
||||||
@ -315,6 +315,14 @@ $tw.utils.PasswordPrompt.prototype.createPrompt = function(options) {
|
|||||||
promptInfo.form.parentNode.removeChild(promptInfo.form);
|
promptInfo.form.parentNode.removeChild(promptInfo.form);
|
||||||
self.setWrapperDisplay();
|
self.setWrapperDisplay();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Clear the password if the callback returned false
|
||||||
|
for(t=0; t<form.elements.length; t++) {
|
||||||
|
var e = form.elements[t];
|
||||||
|
if(e.name === "password") {
|
||||||
|
form.elements[t].value = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user