mirror of https://github.com/keeweb/keeweb.git
Added fingerprint support for changed password
This commit is contained in:
parent
14b953f764
commit
59fa9253b3
|
@ -48,10 +48,14 @@ const Launcher = {
|
|||
}, callback);
|
||||
};
|
||||
|
||||
const filePath = this.parsePath(path);
|
||||
window.resolveLocalFileSystemURL(filePath.dir, dir => {
|
||||
dir.getFile(filePath.file, {create: true}, writeFile);
|
||||
}, callback, callback);
|
||||
if (path.startsWith('cdvfile://')) { // then file exists
|
||||
window.resolveLocalFileSystemURL(path, writeFile, callback, callback);
|
||||
} else { // create file on sd card
|
||||
const filePath = this.parsePath(path);
|
||||
window.resolveLocalFileSystemURL(filePath.dir, dir => {
|
||||
dir.getFile(filePath.file, {create: true}, writeFile);
|
||||
}, callback, callback);
|
||||
}
|
||||
},
|
||||
readFile: function(path, encoding, callback) {
|
||||
window.resolveLocalFileSystemURL(path, fileEntry => {
|
||||
|
@ -187,7 +191,7 @@ const Launcher = {
|
|||
|
||||
const encryptConfig = _.extend({}, this.config, {
|
||||
username: fileId,
|
||||
password: password.getText()
|
||||
password: password
|
||||
});
|
||||
|
||||
FingerprintAuth.encrypt(encryptConfig, result => {
|
||||
|
|
|
@ -163,7 +163,16 @@ const SettingsFileView = Backbone.View.extend({
|
|||
return;
|
||||
}
|
||||
}
|
||||
this.appModel.syncFile(this.model, arg);
|
||||
|
||||
const password = this.$el.find('#settings__file-master-pass').val();
|
||||
const shouldUpdateFingerprint = this.model.get('passwordChanged') && this.model.get('fingerprint'); // save to suggest fingerprint auth after sync
|
||||
|
||||
this.appModel.syncFile(this.model, arg, () => {
|
||||
if (shouldUpdateFingerprint) {
|
||||
this.model.set('fingerprint', null); // erase old fingerprint token
|
||||
this.appModel.saveFileFingerprint(this.model, password);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
saveDefault: function() {
|
||||
|
|
Loading…
Reference in New Issue