aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/app/edit-identity/edit-identity.component.html6
-rw-r--r--src/app/edit-identity/edit-identity.component.ts14
-rw-r--r--src/locales/de/messages.json1
-rw-r--r--src/locales/en/messages.json1
4 files changed, 17 insertions, 5 deletions
diff --git a/src/app/edit-identity/edit-identity.component.html b/src/app/edit-identity/edit-identity.component.html
index 652cb2c..a912457 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -50,12 +50,12 @@
50 </button> 50 </button>
51 </div> 51 </div>
52 </div> 52 </div>
53 <button class="ml-1 btn btn-primary" (click)="abortAttributeImport()">
54 <span class="fa fa-times"></span> {{getMessage("Abort") }}
55 </button>
53 <button class="ml-1 btn btn-primary" (click)="proceedAttributeImport()"> 56 <button class="ml-1 btn btn-primary" (click)="proceedAttributeImport()">
54 <span class="fa fa-download"></span> {{getMessage("import") }} 57 <span class="fa fa-download"></span> {{getMessage("import") }}
55 </button> 58 </button>
56 <button class="ml-1 btn btn-primary" (click)="abortAttributeImport()">
57 <span class="fa fa-download"></span> {{getMessage("Back") }}
58 </button>
59 </div> 59 </div>
60 <div class="text-center card-body" *ngIf="importInProgress && attributesToOverwriteOnImport.length == 0"> 60 <div class="text-center card-body" *ngIf="importInProgress && attributesToOverwriteOnImport.length == 0">
61 <div class="text-center fa fa-4x"> 61 <div class="text-center fa fa-4x">
diff --git a/src/app/edit-identity/edit-identity.component.ts b/src/app/edit-identity/edit-identity.component.ts
index f221e19..9e128bd 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -671,6 +671,7 @@ export class EditIdentityComponent implements OnInit {
671 for (let overwriteInfo of this.attributesToOverwriteOnImport) { 671 for (let overwriteInfo of this.attributesToOverwriteOnImport) {
672 overwriteInfo[1] = target; 672 overwriteInfo[1] = target;
673 } 673 }
674 this.proceedAttributeImport();
674 } 675 }
675 676
676 getAttrValue(attr: Attribute) { 677 getAttrValue(attr: Attribute) {
@@ -710,6 +711,7 @@ export class EditIdentityComponent implements OnInit {
710 } 711 }
711 console.log("Trying to import " + cred.attributes.length + " attributes"); 712 console.log("Trying to import " + cred.attributes.length + " attributes");
712 713
714 var needsUserInteraction = false;
713 for (let attr of cred.attributes) { 715 for (let attr of cred.attributes) {
714 if ((attr.name == "sub") || 716 if ((attr.name == "sub") ||
715 (attr.name == "nonce") || 717 (attr.name == "nonce") ||
@@ -725,13 +727,21 @@ export class EditIdentityComponent implements OnInit {
725 continue; 727 continue;
726 } 728 }
727 console.log("Found conflicting attribute " + attr.name); 729 console.log("Found conflicting attribute " + attr.name);
728 this.attributesToOverwriteOnImport.push([attestation, false]); 730 this.attributesToOverwriteOnImport.push([attestation, !this.isClaimCred(existAttr)]);
729 attestation.id = existAttr.id; 731 attestation.id = existAttr.id;
732 /* If the new attribute is attested, and the old wasn't, we
733 * override by default. Otherwise, we need to have the user
734 * make a decision
735 */
736 if (this.isClaimCred(existAttr)) {
737 needsUserInteraction = true;
738 }
730 break; 739 break;
731 } 740 }
732 this.attributesToImport.push(attestation); 741 this.attributesToImport.push(attestation);
733 } 742 }
734 if (this.attributesToOverwriteOnImport.length > 0) { 743 if ((this.attributesToOverwriteOnImport.length > 0) &&
744 needsUserInteraction) {
735 console.log("Wait for user input"); 745 console.log("Wait for user input");
736 return; 746 return;
737 } 747 }
diff --git a/src/locales/de/messages.json b/src/locales/de/messages.json
index 71d089e..663b4ea 100644
--- a/src/locales/de/messages.json
+++ b/src/locales/de/messages.json
@@ -10,6 +10,7 @@
10 "Save": "Speichern", 10 "Save": "Speichern",
11 "Note": "Hinweis: ", 11 "Note": "Hinweis: ",
12 "Value": "Wert", 12 "Value": "Wert",
13 "Abort": "Abbrechen",
13 "keepAll": "Alle behalten", 14 "keepAll": "Alle behalten",
14 "overwriteAll": "Alle überschreiben", 15 "overwriteAll": "Alle überschreiben",
15 "import": "Importieren", 16 "import": "Importieren",
diff --git a/src/locales/en/messages.json b/src/locales/en/messages.json
index 21ca678..0ea8be8 100644
--- a/src/locales/en/messages.json
+++ b/src/locales/en/messages.json
@@ -10,6 +10,7 @@
10 "Save": "Save", 10 "Save": "Save",
11 "Note": "Note: ", 11 "Note": "Note: ",
12 "Value": "Value", 12 "Value": "Value",
13 "Abort": "Abort",
13 "keepAll": "Keep all", 14 "keepAll": "Keep all",
14 "overwriteAll": "Overwrite all", 15 "overwriteAll": "Overwrite all",
15 "import": "Import", 16 "import": "Import",