diff --git a/src/background.html b/src/background.html index 118292fa..1c618fa8 100644 --- a/src/background.html +++ b/src/background.html @@ -6,7 +6,6 @@ - diff --git a/src/popup/app/config.js b/src/popup/app/config.js index 06a54a0f..b5b29d9c 100644 --- a/src/popup/app/config.js +++ b/src/popup/app/config.js @@ -265,7 +265,7 @@ angular }); }) .run(function ($trace, $transitions, userService, $state, constantsService, stateService) { - $trace.enable('TRANSITION'); + //$trace.enable('TRANSITION'); stateService.init(); diff --git a/src/popup/app/lock/lockController.js b/src/popup/app/lock/lockController.js index fa9eae49..d185f68c 100644 --- a/src/popup/app/lock/lockController.js +++ b/src/popup/app/lock/lockController.js @@ -26,7 +26,9 @@ angular $scope.submit = function () { userService.getEmail(function (email) { var key = cryptoService.makeKey($scope.masterPassword, email); - cryptoService.hashPassword($scope.masterPassword, key).then(function (keyHash) { + var keyHash; + cryptoService.hashPassword($scope.masterPassword, key).then(function (theKeyHash) { + keyHash = theKeyHash; return cryptoService.getKeyHash(); }).then(function (storedKeyHash) { if (storedKeyHash && keyHash && storedKeyHash === keyHash) { diff --git a/src/popup/app/services/authService.js b/src/popup/app/services/authService.js index 6bd72be8..52b9ba50 100644 --- a/src/popup/app/services/authService.js +++ b/src/popup/app/services/authService.js @@ -9,12 +9,14 @@ angular email = email.toLowerCase(); var key = cryptoService.makeKey(masterPassword, email), deferred = $q.defer(), - deviceRequest = null; + deviceRequest = null, + twoFactorRememberedToken; appIdService.getAppId().then(function (appId) { deviceRequest = new DeviceRequest(appId, utilsService); return tokenService.getTwoFactorToken(email); - }).then(function (twoFactorRememberedToken) { + }).then(function (theTwoFactorRememberedToken) { + twoFactorRememberedToken = theTwoFactorRememberedToken; return cryptoService.hashPassword(masterPassword, key); }).then(function (hashedPassword) { var request; diff --git a/src/popup/app/tools/toolsExportController.js b/src/popup/app/tools/toolsExportController.js index 29621664..d03bb2e6 100644 --- a/src/popup/app/tools/toolsExportController.js +++ b/src/popup/app/tools/toolsExportController.js @@ -24,7 +24,9 @@ angular userService.getEmail(function (email) { var key = cryptoService.makeKey($scope.masterPassword, email); - cryptoService.hashPassword($scope.masterPassword, key).then(function (keyHash) { + var keyHash; + cryptoService.hashPassword($scope.masterPassword, key).then(function (theKeyHash) { + keyHash = theKeyHash; return cryptoService.getKeyHash(); }).then(function (storedKeyHash) { if (storedKeyHash && keyHash && storedKeyHash === keyHash) { diff --git a/src/services/crypto.service.ts b/src/services/crypto.service.ts index 3b955e2c..29014f65 100644 --- a/src/services/crypto.service.ts +++ b/src/services/crypto.service.ts @@ -76,7 +76,7 @@ export default class CryptoService { async getKey(): Promise { if (this.key != null) { - return; + return this.key; } const option = await this.utilsService.getObjFromStorage(ConstantsService.lockOptionKey); @@ -126,7 +126,7 @@ export default class CryptoService { async getPrivateKey(): Promise { if (this.privateKey != null) { - return Promise.resolve(this.privateKey); + return this.privateKey; } const encPrivateKey = await this.utilsService.getObjFromStorage(Keys.encPrivateKey);