1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-30 13:03:53 +01:00

totp flag on logins

This commit is contained in:
Kyle Spearrin 2017-07-07 14:07:30 -04:00
parent 49dbf4945f
commit 08b432775e
4 changed files with 8 additions and 10 deletions

View File

@ -7,11 +7,11 @@ angular
$scope.go = function () { $scope.go = function () {
$analytics.eventTrack('Get Paid Org'); $analytics.eventTrack('Get Paid Org');
$state.go('backend.org.billing', { orgId: orgId }).then(function () { $state.go('backend.org.billing', { orgId: orgId }).then(function () {
$scope.close(); $uibModalStack.dismissAll();
}); });
}; };
$scope.close = function () { $scope.close = function () {
$uibModalStack.dismissAll(); $uibModalInstance.dismiss('close');
}; };
}); });

View File

@ -7,11 +7,11 @@ angular
$scope.go = function () { $scope.go = function () {
$analytics.eventTrack('Get Premium'); $analytics.eventTrack('Get Premium');
$state.go('backend.user.settingsPremium').then(function () { $state.go('backend.user.settingsPremium').then(function () {
$scope.close(); $uibModalStack.dismissAll();
}); });
}; };
$scope.close = function () { $scope.close = function () {
$uibModalStack.dismissAll(); $uibModalInstance.dismiss('close');
}; };
}); });

View File

@ -2,18 +2,14 @@
.module('bit.vault') .module('bit.vault')
.controller('organizationVaultEditLoginController', function ($scope, apiService, $uibModalInstance, cryptoService, .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' }); $analytics.eventTrack('organizationVaultEditLoginController', { category: 'Modal' });
$scope.login = {}; $scope.login = {};
$scope.hideFolders = $scope.hideFavorite = $scope.fromOrg = true; $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) { apiService.logins.getAdmin({ id: loginId }, function (login) {
$scope.login = cipherService.decryptLogin(login); $scope.login = cipherService.decryptLogin(login);
$scope.useTotp = $scope.login.organizationUseTotp;
}); });
$scope.save = function (model) { $scope.save = function (model) {

View File

@ -31,6 +31,7 @@ angular
folderId: encryptedLogin.FolderId, folderId: encryptedLogin.FolderId,
favorite: encryptedLogin.Favorite, favorite: encryptedLogin.Favorite,
edit: encryptedLogin.Edit, edit: encryptedLogin.Edit,
organizationUseTotp: encryptedLogin.OrganizationUseTotp,
name: cryptoService.decrypt(encryptedLogin.Name, key), name: cryptoService.decrypt(encryptedLogin.Name, key),
uri: encryptedLogin.Uri && encryptedLogin.Uri !== '' ? cryptoService.decrypt(encryptedLogin.Uri, key) : null, uri: encryptedLogin.Uri && encryptedLogin.Uri !== '' ? cryptoService.decrypt(encryptedLogin.Uri, key) : null,
username: encryptedLogin.Username && encryptedLogin.Username !== '' ? cryptoService.decrypt(encryptedLogin.Username, key) : null, username: encryptedLogin.Username && encryptedLogin.Username !== '' ? cryptoService.decrypt(encryptedLogin.Username, key) : null,
@ -67,6 +68,7 @@ angular
folderId: encryptedCipher.FolderId, folderId: encryptedCipher.FolderId,
favorite: encryptedCipher.Favorite, favorite: encryptedCipher.Favorite,
edit: encryptedCipher.Edit, edit: encryptedCipher.Edit,
organizationUseTotp: encryptedCipher.OrganizationUseTotp,
name: _service.decryptProperty(encryptedCipher.Data.Name, key, false), name: _service.decryptProperty(encryptedCipher.Data.Name, key, false),
username: _service.decryptProperty(encryptedCipher.Data.Username, key, true), username: _service.decryptProperty(encryptedCipher.Data.Username, key, true),
password: _service.decryptProperty(encryptedCipher.Data.Password, key, true), password: _service.decryptProperty(encryptedCipher.Data.Password, key, true),