1
0
mirror of https://github.com/bitwarden/web synced 2025-12-16 16:23:31 +00:00

add new org to profile

This commit is contained in:
Kyle Spearrin
2017-03-11 20:46:33 -05:00
parent 1cbd322105
commit 0acab61f2e
3 changed files with 46 additions and 3 deletions

View File

@@ -80,6 +80,26 @@ angular
apiService.accounts.getProfile({}, loadProfile);
};
_service.addProfileOrganization = function (org) {
var profile = _service.getUserProfile();
if (profile) {
if (!profile.Organizations) {
profile.Organizations = [];
}
var org = {
id: org.Id,
name: org.Name,
key: org.Key,
status: org.Status
};
profile.organizations.push(org);
_userProfile = profile;
cryptoService.addOrgKey(org);
}
};
function loadProfile(profile) {
_userProfile.extended = {
name: profile.Name,