From 08b432775e7cbee3ff6df630f7208f1686ce9b7e Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 7 Jul 2017 14:07:30 -0400 Subject: [PATCH] totp flag on logins --- src/app/global/paidOrgRequiredController.js | 4 ++-- src/app/global/premiumRequiredController.js | 4 ++-- .../organization/organizationVaultEditLoginController.js | 8 ++------ src/app/services/cipherService.js | 2 ++ 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/app/global/paidOrgRequiredController.js b/src/app/global/paidOrgRequiredController.js index 02f72a6a50..3f2ed1794e 100644 --- a/src/app/global/paidOrgRequiredController.js +++ b/src/app/global/paidOrgRequiredController.js @@ -7,11 +7,11 @@ angular $scope.go = function () { $analytics.eventTrack('Get Paid Org'); $state.go('backend.org.billing', { orgId: orgId }).then(function () { - $scope.close(); + $uibModalStack.dismissAll(); }); }; $scope.close = function () { - $uibModalStack.dismissAll(); + $uibModalInstance.dismiss('close'); }; }); diff --git a/src/app/global/premiumRequiredController.js b/src/app/global/premiumRequiredController.js index 91502f86c2..9b870eb8d6 100644 --- a/src/app/global/premiumRequiredController.js +++ b/src/app/global/premiumRequiredController.js @@ -7,11 +7,11 @@ angular $scope.go = function () { $analytics.eventTrack('Get Premium'); $state.go('backend.user.settingsPremium').then(function () { - $scope.close(); + $uibModalStack.dismissAll(); }); }; $scope.close = function () { - $uibModalStack.dismissAll(); + $uibModalInstance.dismiss('close'); }; }); diff --git a/src/app/organization/organizationVaultEditLoginController.js b/src/app/organization/organizationVaultEditLoginController.js index 796040200d..064fd83be1 100644 --- a/src/app/organization/organizationVaultEditLoginController.js +++ b/src/app/organization/organizationVaultEditLoginController.js @@ -2,18 +2,14 @@ .module('bit.vault') .controller('organizationVaultEditLoginController', function ($scope, apiService, $uibModalInstance, cryptoService, - cipherService, passwordService, loginId, $analytics, authService, orgId, $uibModal) { + cipherService, passwordService, loginId, $analytics, orgId, $uibModal) { $analytics.eventTrack('organizationVaultEditLoginController', { category: 'Modal' }); $scope.login = {}; $scope.hideFolders = $scope.hideFavorite = $scope.fromOrg = true; - authService.getUserProfile().then(function (userProfile) { - var orgProfile = userProfile.organizations[orgId]; - $scope.useTotp = orgProfile.useTotp; - }); - apiService.logins.getAdmin({ id: loginId }, function (login) { $scope.login = cipherService.decryptLogin(login); + $scope.useTotp = $scope.login.organizationUseTotp; }); $scope.save = function (model) { diff --git a/src/app/services/cipherService.js b/src/app/services/cipherService.js index a2c1da6715..cdef2fa15f 100644 --- a/src/app/services/cipherService.js +++ b/src/app/services/cipherService.js @@ -31,6 +31,7 @@ angular folderId: encryptedLogin.FolderId, favorite: encryptedLogin.Favorite, edit: encryptedLogin.Edit, + organizationUseTotp: encryptedLogin.OrganizationUseTotp, name: cryptoService.decrypt(encryptedLogin.Name, key), uri: encryptedLogin.Uri && encryptedLogin.Uri !== '' ? cryptoService.decrypt(encryptedLogin.Uri, key) : null, username: encryptedLogin.Username && encryptedLogin.Username !== '' ? cryptoService.decrypt(encryptedLogin.Username, key) : null, @@ -67,6 +68,7 @@ angular folderId: encryptedCipher.FolderId, favorite: encryptedCipher.Favorite, edit: encryptedCipher.Edit, + organizationUseTotp: encryptedCipher.OrganizationUseTotp, name: _service.decryptProperty(encryptedCipher.Data.Name, key, false), username: _service.decryptProperty(encryptedCipher.Data.Username, key, true), password: _service.decryptProperty(encryptedCipher.Data.Password, key, true),