From 905d09899c44ae970de2642d30ddd280db12f14b Mon Sep 17 00:00:00 2001 From: antelle Date: Sat, 21 Mar 2020 15:54:12 +0100 Subject: [PATCH] fix #1295, fix #1353: displaying passwords as protected fields regardless of settings in the file --- app/scripts/models/entry-model.js | 10 +++++++++- release-notes.md | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/scripts/models/entry-model.js b/app/scripts/models/entry-model.js index 734de367..0b10d2a8 100644 --- a/app/scripts/models/entry-model.js +++ b/app/scripts/models/entry-model.js @@ -45,7 +45,7 @@ class EntryModel extends Model { this.fileName = this.file.name; this.groupName = this.group.title; this.title = this._getFieldString('Title'); - this.password = entry.fields.Password || kdbxweb.ProtectedValue.fromString(''); + this.password = this._getPassword(); this.notes = this._getFieldString('Notes'); this.url = this._getFieldString('URL'); this.displayUrl = this._getDisplayUrl(this._getFieldString('URL')); @@ -71,6 +71,14 @@ class EntryModel extends Model { } } + _getPassword() { + const password = this.entry.fields.Password || kdbxweb.ProtectedValue.fromString(''); + if (!password.isProtected) { + return kdbxweb.ProtectedValue.fromString(password); + } + return password; + } + _getFieldString(field) { const val = this.entry.fields[field]; if (!val) { diff --git a/release-notes.md b/release-notes.md index ed3aff7f..d995703f 100644 --- a/release-notes.md +++ b/release-notes.md @@ -33,6 +33,7 @@ Release notes `-` fix #1338: minimized option not working on linux `-` fix #895: generator positioning in list view `-` fix #516: scrolling on the open screen on mobile +`-` fix #1295, #1353: displaying passwords as protected fields regardless of settings in the file ##### v1.12.3 (2019-11-06) `-` fix #1335: removed the menubar on Windows and Linux