From 822face7a3513a709277a197e27fd550b7b21954 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 22 Nov 2016 16:29:46 -0800 Subject: Fix password reference --- app/scripts/keyring-controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/scripts/keyring-controller.js') diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 4fa2b4ee8..141a1281a 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -274,8 +274,9 @@ module.exports = class KeyringController extends EventEmitter { unlockKeyrings (password) { const encryptedVault = this.configManager.getVault() - return this.encryptor.decrypt(this.password, encryptedVault) + return this.encryptor.decrypt(password, encryptedVault) .then((vault) => { + this.password = password vault.forEach(this.restoreKeyring.bind(this)) return this.keyrings }) -- cgit v1.2.3 From 05c8658ff343af61b1a40a5624ecba77adb2ef00 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 22 Nov 2016 17:40:29 -0800 Subject: Fix new encryptor migration logic --- app/scripts/keyring-controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/scripts/keyring-controller.js') diff --git a/app/scripts/keyring-controller.js b/app/scripts/keyring-controller.js index 141a1281a..68cf62f7a 100644 --- a/app/scripts/keyring-controller.js +++ b/app/scripts/keyring-controller.js @@ -118,6 +118,7 @@ module.exports = class KeyringController extends EventEmitter { return this.idStoreMigrator.migratedVaultForPassword(password) .then((serialized) => { if (serialized && shouldMigrate) { + this.password = password const keyring = this.restoreKeyring(serialized) this.keyrings.push(keyring) this.configManager.setSelectedAccount(keyring.getAccounts()[0]) @@ -185,7 +186,6 @@ module.exports = class KeyringController extends EventEmitter { cb(null, this.getState()) }) .catch((err) => { - console.error(err) cb(err) }) } @@ -558,7 +558,7 @@ module.exports = class KeyringController extends EventEmitter { } setLocked (cb) { - this.key = null + this.password = null this.keyrings = [] this.emit('update') cb() -- cgit v1.2.3