gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 116/459: authentication screen update - retry client verifi


From: gnunet
Subject: [reclaim-ui] 116/459: authentication screen update - retry client verification
Date: Fri, 11 Jun 2021 23:23:28 +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 af0275f9c965b910acd92eb2b17bf54b031d5c53
Author: Alexia Pagkopoulou <a.pagkopoulou@tum.de>
AuthorDate: Tue Jul 9 14:44:38 2019 +0200

    authentication screen update - retry client verification
---
 src/app/gns.service.ts                             |  5 ++-
 src/app/identity-list/identity-list.component.html | 36 +++++++++++++---------
 src/app/identity-list/identity-list.component.ts   | 17 +++++-----
 3 files changed, 34 insertions(+), 24 deletions(-)

diff --git a/src/app/gns.service.ts b/src/app/gns.service.ts
index 183ea6f..e6ae699 100644
--- a/src/app/gns.service.ts
+++ b/src/app/gns.service.ts
@@ -10,8 +10,7 @@ export class GnsService {
   constructor(private http: HttpClient, private config: ConfigService) { }
 
   getClientName(client_id) {
-    return this.http.get<any>(this.config.get().apiUrl 
-      + '/gns/'+client_id+'?record_type=RECLAIM_OIDC_CLIENT');
+    return this.http.get<any>(this.config.get().apiUrl
+      + '/gns/' + client_id + '?record_type=RECLAIM_OIDC_CLIENT').retry(3);
   }
-
 }
diff --git a/src/app/identity-list/identity-list.component.html 
b/src/app/identity-list/identity-list.component.html
index f46afd3..18d2c29 100644
--- a/src/app/identity-list/identity-list.component.html
+++ b/src/app/identity-list/identity-list.component.html
@@ -3,29 +3,37 @@
   <div style="text-align: center;">
     <div class="logo"><img src="assets/reclaim_icon.png"/></div>
     <hr>
-    <span *ngIf="clientNameFound()">
-    <i class="fa fa-2x fa-openid"></i> 
-    <b class="fa-2x"> Authorization Request </b>
-    </span>
-    <span *ngIf="!clientNameFound()">
+    <span *ngIf="clientNameFound === undefined">
       <i class="fa fa-2x fa-circle-o-notch fa-spin fa-fw"></i> 
       <b class="fa-2x"> Verifying request, please stand by...</b>
     </span>
+    <span *ngIf="clientNameFound">
+      <i class="fa fa-2x fa-openid"></i> 
+      <b class="fa-2x"> Authorization Request </b>
+    </span> 
+    <span *ngIf="clientNameFound !== undefined && !clientNameFound">
+      <b class="fa-2x"> Authorization failed. </b>
+    </span>
     <br/> 
   </div>
-  <div *ngIf="clientNameFound()"><strong>"{{ clientName }}"</strong>
+  <div *ngIf="clientNameFound"><strong>"{{ clientName }}"</strong>
     asks you to share personal information.<br/>
     Choose an identity to let it access the following information:
   </div>
-  <ul *ngIf="clientNameFound()">
+  <ul *ngIf="clientNameFound">
     <li *ngFor="let attribute of getScopes()"><strong>{{attribute}}</strong>
   </ul>
-  <div style="text-align: center;">
-    <button class="btn btn-danger mt-4" (click)="cancelRequest(); 
closeModal('OpenIdInfo');" style="margin-bottom: -4%;">
+  <div *ngIf="clientNameFound" style="text-align: center;">
+    <button class="btn btn-danger mt-4" *ngIf="clientNameFound" 
(click)="cancelRequest(); closeModal('OpenIdInfo');" style="margin-bottom: 
-4%;">
       <span class="fa fa-ban"></span> Decline and return to website 
     </button>
     <br/>
-    <button class="btn btn-primary mt-4" 
(click)="closeModal('OpenIdInfo');">Choose Identity</button>
+    <button class="btn btn-primary mt-4" *ngIf="clientNameFound" 
(click)="closeModal('OpenIdInfo');">Choose Identity</button>
+  </div>
+  <div *ngIf="clientNameFound !== undefined && !clientNameFound" 
style="text-align: center;">
+    <button class="btn btn-primary mt-4" *ngIf="!clientNameFound" 
(click)="getClientName();">
+      <span class="fa fa-openid"></span> Retry
+    </button>
   </div>
 </oid-modal>
 
@@ -244,9 +252,9 @@
       <div>
 
         <div>
-          <button *ngIf="canAuthorize(identity)" [disabled]="!inOpenIdFlow() 
|| isAttributeMissing(identity) || !clientNameFound()" 
(click)="loginIdentity(identity)" class="btn btn-primary mr-1 openid-login">
-            <span *ngIf="clientNameFound()"><i class="fa fa-openid"></i> Share 
from this identity</span>
-            <span *ngIf="!clientNameFound()"><i class="fa 
fa-exclamation-circle"></i> Sharing disabled</span>
+          <button *ngIf="canAuthorize(identity)" [disabled]="!inOpenIdFlow() 
|| isAttributeMissing(identity) || !clientNameFound" 
(click)="loginIdentity(identity)" class="btn btn-primary mr-1 openid-login">
+            <span *ngIf="clientNameFound"><i class="fa fa-openid"></i> Share 
from this identity</span>
+            <span *ngIf="!clientNameFound"><i class="fa 
fa-exclamation-circle"></i> Sharing disabled</span>
           </button>
         </div>
       </div>
@@ -303,7 +311,7 @@
   </button>
 </div>
 <!-- Cancel authorization -->
-<div *ngIf="inOpenIdFlow() && !isAddIdentity() && (null == identityInEdit)" 
style="margin-bottom: 1em; text-align: center;">
+<div *ngIf="inOpenIdFlow() && !isAddIdentity() && (null == identityInEdit) && 
clientNameFound" style="margin-bottom: 1em; text-align: center;">
   <button class="btn btn-danger mt-4" (click)="cancelRequest()">
     <span class="fa fa-ban"></span> Decline and return to website
   </button>
diff --git a/src/app/identity-list/identity-list.component.ts 
b/src/app/identity-list/identity-list.component.ts
index fa1ef0e..2fdcf77 100644
--- a/src/app/identity-list/identity-list.component.ts
+++ b/src/app/identity-list/identity-list.component.ts
@@ -40,7 +40,7 @@ export class IdentityListComponent implements OnInit {
   connected: any;
   ticketAttributeMapper: any;
   modalOpened: any;
-
+  clientNameFound: any;
 
   constructor(private route: ActivatedRoute, private router: Router,
               private oidcService: OpenIdService,
@@ -127,6 +127,7 @@ export class IdentityListComponent implements OnInit {
 
   getClientName()
   {
+    this.clientNameFound = undefined;
     this.clientName = this.oidcService.getClientId();
     this.gnsService.getClientName(this.oidcService.getClientId())
         .subscribe(record => {
@@ -136,15 +137,17 @@ export class IdentityListComponent implements OnInit {
             if (records[i].record_type !== "RECLAIM_OIDC_CLIENT")
               continue;
             this.clientName = records[i].value;
-            break;
+            this.clientNameFound = true;
+            return;
           }
-        });
+          this.clientNameFound = false;
+        }, error => { this.clientNameFound = false; });
   }
 
-  clientNameFound()
-  {
-    return this.clientName !== this.oidcService.getClientId();
-  }
+  //clientNameFound()
+  //{
+  //return this.clientName !== this.oidcService.getClientId();
+  //}
 
   intToRGB(i)
   {

-- 
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]