aboutsummaryrefslogtreecommitdiff
path: root/src/app/edit-identity/edit-identity.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/edit-identity/edit-identity.component.ts')
-rw-r--r--src/app/edit-identity/edit-identity.component.ts63
1 files changed, 32 insertions, 31 deletions
diff --git a/src/app/edit-identity/edit-identity.component.ts b/src/app/edit-identity/edit-identity.component.ts
index df71408..2de41e0 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -91,7 +91,6 @@ export class EditIdentityComponent implements OnInit {
91 if (ids[i].name == p['id']) { 91 if (ids[i].name == p['id']) {
92 this.identity = ids[i]; 92 this.identity = ids[i];
93 this.updateAttributes(); 93 this.updateAttributes();
94 this.updateCredentials();
95 } 94 }
96 } 95 }
97 }); 96 });
@@ -167,36 +166,39 @@ export class EditIdentityComponent implements OnInit {
167 166
168 private updateAttributes() { 167 private updateAttributes() {
169 this.reclaimService.getAttributes(this.identity).subscribe(attributes => { 168 this.reclaimService.getAttributes(this.identity).subscribe(attributes => {
170 this.existingProfileClaims = this.bootstrapClaimArray (this.oidcService.getStandardProfileClaims()); 169 this.reclaimService.getCredentials(this.identity).subscribe(credentials => {
171 this.existingEmailClaims = this.bootstrapClaimArray (this.oidcService.getStandardEmailClaims()); 170 this.credentials = credentials;
172 this.existingPhoneClaims = this.bootstrapClaimArray (this.oidcService.getStandardPhoneClaims()); 171 this.existingProfileClaims = this.bootstrapClaimArray (this.oidcService.getStandardProfileClaims());
173 this.existingAddressClaims = this.bootstrapClaimArray (this.oidcService.getStandardAddressClaims()); 172 this.existingEmailClaims = this.bootstrapClaimArray (this.oidcService.getStandardEmailClaims());
174 this.existingNonStandardClaims = []; 173 this.existingPhoneClaims = this.bootstrapClaimArray (this.oidcService.getStandardPhoneClaims());
175 this.attributes = this.sortAttributes(attributes); 174 this.existingAddressClaims = this.bootstrapClaimArray (this.oidcService.getStandardAddressClaims());
176 for (let attr of this.attributes) { 175 this.existingNonStandardClaims = [];
177 if (this.oidcService.isStandardProfileClaim(attr)) { 176 this.attributes = this.sortAttributes(attributes);
178 this.existingProfileClaims = this.updateClaimArray(this.existingProfileClaims, attr); 177 for (let attr of this.attributes) {
179 } else if (this.oidcService.isStandardEmailClaim(attr)) { 178 if (this.oidcService.isStandardProfileClaim(attr)) {
180 this.existingEmailClaims = this.updateClaimArray(this.existingEmailClaims, attr); 179 this.existingProfileClaims = this.updateClaimArray(this.existingProfileClaims, attr);
181 } else if (this.oidcService.isStandardAddressClaim(attr)) { 180 } else if (this.oidcService.isStandardEmailClaim(attr)) {
182 this.existingAddressClaims = this.updateClaimArray(this.existingAddressClaims, attr); 181 this.existingEmailClaims = this.updateClaimArray(this.existingEmailClaims, attr);
183 } else if (this.oidcService.isStandardPhoneClaim(attr)) { 182 } else if (this.oidcService.isStandardAddressClaim(attr)) {
184 this.existingPhoneClaims = this.updateClaimArray(this.existingPhoneClaims, attr); 183 this.existingAddressClaims = this.updateClaimArray(this.existingAddressClaims, attr);
185 } else { 184 } else if (this.oidcService.isStandardPhoneClaim(attr)) {
186 this.existingNonStandardClaims.push(attr); 185 this.existingPhoneClaims = this.updateClaimArray(this.existingPhoneClaims, attr);
186 } else {
187 this.existingNonStandardClaims.push(attr);
188 }
187 } 189 }
188 } 190 this.existingProfileClaims = this.cleanupClaimArray(this.existingProfileClaims);
189 this.existingProfileClaims = this.cleanupClaimArray(this.existingProfileClaims); 191 this.existingEmailClaims = this.cleanupClaimArray(this.existingEmailClaims);
190 this.existingEmailClaims = this.cleanupClaimArray(this.existingEmailClaims); 192 this.existingPhoneClaims = this.cleanupClaimArray(this.existingPhoneClaims);
191 this.existingPhoneClaims = this.cleanupClaimArray(this.existingPhoneClaims); 193 this.existingAddressClaims = this.cleanupClaimArray(this.existingAddressClaims);
192 this.existingAddressClaims = this.cleanupClaimArray(this.existingAddressClaims); 194 this.updateMissingAttributes();
193 this.updateMissingAttributes(); 195 this.validateEmailForImport();
194 this.validateEmailForImport(); 196 this.resetAttributes();
195 this.resetAttributes(); 197 },
196 }, 198 err => {
197 err => { 199 //this.errorInfos.push("Error retrieving attributes for ``" + identity.name + "''");
198 //this.errorInfos.push("Error retrieving attributes for ``" + identity.name + "''"); 200 console.log(err);
199 console.log(err); 201 });
200 }); 202 });
201 } 203 }
202 204
@@ -661,7 +663,6 @@ export class EditIdentityComponent implements OnInit {
661 this.importInProgress = false; 663 this.importInProgress = false;
662 this.oauthService.logOut(); 664 this.oauthService.logOut();
663 this.updateAttributes(); 665 this.updateAttributes();
664 this.updateCredentials();
665 }) 666 })
666 ).subscribe(res => { 667 ).subscribe(res => {
667 console.log("Finished attribute import."); 668 console.log("Finished attribute import.");