1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00

All: Fixed setting issue that would cause a password to be saved in plain text in the database, even when the keychain is working

This commit is contained in:
Laurent Cozic
2020-10-20 16:37:14 +01:00
parent b125a768b8
commit 03063f1137
2 changed files with 15 additions and 0 deletions

View File

@ -1318,6 +1318,11 @@ class Setting extends BaseModel {
if (currentValue !== s.value) {
const wasSet = await this.keychainService().setPassword(passwordName, s.value);
if (wasSet) continue;
} else {
// The value is already in the keychain - so nothing to do
// Make sure to `continue` here otherwise it will save the password
// in clear text in the database.
continue;
}
} catch (error) {
this.logger().error(`Could not set setting on the keychain. Will be saved to database instead: ${s.key}:`, error);