gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[reclaim-ui] 185/459: minor fixes


From: gnunet
Subject: [reclaim-ui] 185/459: minor fixes
Date: Fri, 11 Jun 2021 23:24:37 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository reclaim-ui.

commit 3f36d635502e1e1f7014c7a7d4d0b1d87f700a0d
Author: Schanzenbach, Martin <mschanzenbach@posteo.de>
AuthorDate: Thu Feb 6 16:14:08 2020 +0100

    minor fixes
---
 .../edit-attestations.component.ts                 | 27 +++++++++++-----------
 src/app/edit-identity/edit-identity.component.css  | 11 +++++++++
 src/app/edit-identity/edit-identity.component.html |  4 ++++
 src/app/edit-identity/edit-identity.component.ts   |  7 +++++-
 4 files changed, 35 insertions(+), 14 deletions(-)

diff --git a/src/app/edit-attestations/edit-attestations.component.ts 
b/src/app/edit-attestations/edit-attestations.component.ts
index 04df369..713128a 100644
--- a/src/app/edit-attestations/edit-attestations.component.ts
+++ b/src/app/edit-attestations/edit-attestations.component.ts
@@ -39,23 +39,24 @@ export class EditAttestationsComponent implements OnInit {
             if (ids[i].name == p['id']) {
               this.identity = ids[i];
               this.updateAttestation();
+              let code = localStorage.getItem('attestationCode');
+              if (undefined !== code) {
+                console.log(code);
+                this.reclaimService.fixmeExchangeCode(code).subscribe(response 
=> {
+                  if (undefined !== response["id_token"]) {
+                    this.newAttestation.value = response["id_token"];
+                    this.newAttestation.type = "JWT";
+                    this.newAttestation.name = "FraunhoferAISEC";
+                    this.addAttestation();
+                    localStorage.setItem('attestationCode', null);
+                    this.router.navigate(['/edit-identity', 
this.identity.name]);
+                  }
+                });;
+              }
             }
           }
         });
     });
-    let code = localStorage.getItem('attestationCode');
-    if (undefined !== code) {
-      console.log(code);
-      this.reclaimService.fixmeExchangeCode(code).subscribe(response => {
-        if (undefined !== response["id_token"]) {
-          this.newAttestation.value = response["id_token"];
-          this.newAttestation.type = "JWT";
-          this.newAttestation.name = "FraunhoferAISEC";
-          this.addAttestation();
-          localStorage.setItem('attestationCode', null);
-        }
-      });;
-    }
   }
 
   private updateAttestation() {
diff --git a/src/app/edit-identity/edit-identity.component.css 
b/src/app/edit-identity/edit-identity.component.css
index e69de29..58a74cc 100644
--- a/src/app/edit-identity/edit-identity.component.css
+++ b/src/app/edit-identity/edit-identity.component.css
@@ -0,0 +1,11 @@
+button.fhg-link {
+  background-color: #009374;
+  border: 2px solid #fff;
+  color: #fff;
+}
+
+button.fhg-link:hover {
+  background-color: #fff;
+  border: 2px solid #009374;
+  color: #009374;
+}
diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index 1c42501..a6c1db5 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -141,6 +141,10 @@
         <li>IDs and values may not be empty!</li>
       </ul>
     </div>
+    <button class="btn btn-primary mb-4 fhg-link" 
(click)="getFhGAttestation()">
+      <span class="fa fa-user"></span> Link Fraunhofer Account
+    </button>
+    <hr/>
 
     <!-- Edit card buttons -->
     <div>
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index 2cdc05c..76fbdc9 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -291,7 +291,7 @@ export class EditIdentityComponent implements OnInit {
     if (attribute.name.indexOf(' ') >= 0) {
       return false;
     }
-    if (!/^[a-zA-Z0-9-]+$/.test(attribute.name)) {
+    if (!/^[a-zA-Z0-9-_]+$/.test(attribute.name)) {
       return false;
     }
     return !this.isInConflict(attribute);
@@ -661,4 +661,9 @@ export class EditIdentityComponent implements OnInit {
     }
   }
 
+  getFhGAttestation() {
+    localStorage.setItem('userForAttestation', this.identity.name);
+    window.location.href = 
"http://localhost:4567/authorize?redirect_uri=http%3A%2F%2Flocalhost:4200%2Findex.html&client_id=reclaimid&response_type=code&scopes=openid";;
+  }
+
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]