1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-04 17:43:39 +00:00

org keys and optimized org profile load for sidenav

This commit is contained in:
Kyle Spearrin
2017-03-06 23:54:06 -05:00
parent b3c8337f83
commit 0ea4b4400f
6 changed files with 84 additions and 14 deletions

View File

@@ -7,7 +7,13 @@
$scope.confirm = function (user) {
apiService.users.getPublicKey({ id: user.userId }, function (userKey) {
var key = cryptoService.rsaEncrypt('org key', userKey.PublicKey);
var orgKey = cryptoService.getOrgKey($state.params.orgId);
if (!orgKey) {
toastr.error('Unable to confirm user.', 'Error');
return;
}
var key = cryptoService.rsaEncrypt(orgKey, userKey.PublicKey);
apiService.organizationUsers.confirm({ orgId: $state.params.orgId, id: user.id }, { key: key }, function () {
user.status = 2;
toastr.success(user.email + ' has been confirmed.', 'User Confirmed');