gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 235/459: code duplicates removed


From: gnunet
Subject: [reclaim-ui] 235/459: code duplicates removed
Date: Fri, 11 Jun 2021 23:25:27 +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 f82ffb3baaa815dcf945632cda7c2f997edf628e
Author: anna wimbauer <anna.wibauer@gmx.de>
AuthorDate: Mon Jul 13 11:44:29 2020 +0200

    code duplicates removed
---
 src/app/edit-identity/edit-identity.component.html |  2 +-
 src/app/edit-identity/edit-identity.component.ts   | 58 +++-------------------
 2 files changed, 7 insertions(+), 53 deletions(-)

diff --git a/src/app/edit-identity/edit-identity.component.html 
b/src/app/edit-identity/edit-identity.component.html
index c70b141..418ddfb 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -164,7 +164,7 @@
       <span class="fa fa-openid"></span> Link account
     </button>
     <!--Link account-->
-    <button *ngIf="newIdProviderDiscovered() && !grantedAccessToIdProvider()" 
class="btn btn-primary mb-4 fhg-link" (click)="loginFhgAccount()">
+    <button *ngIf="newIdProviderDiscovered()" class="btn btn-primary mb-4 
fhg-link" (click)="loginFhgAccount()">
       <span class="fa fa-user"></span> Grant Access to {{newIdProvider.name}}
     </button>
     <button *ngIf="newIdProviderDiscovered()" class="btn btn-primary mb-4 
fhg-link" (click)="cancelLinking()">
diff --git a/src/app/edit-identity/edit-identity.component.ts 
b/src/app/edit-identity/edit-identity.component.ts
index 816158e..2efd390 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -11,9 +11,9 @@ import { IdentityService } from '../identity.service';
 import { finalize } from 'rxjs/operators';
 import { from, forkJoin, EMPTY } from 'rxjs';
 import { AttestationService } from '../attestation.service';
-import { OAuthService } from 'angular-oauth2-oidc';
 import { Authorization } from '../authorization';
 import { IdProvider } from '../idProvider';
+import { OAuthService } from 'angular-oauth2-oidc';
 
 
 @Component({
@@ -65,10 +65,6 @@ export class EditIdentityComponent implements OnInit {
     this.newAttested = new Attribute('', '', '', '', 'STRING', '');
     this.newAttestation = new Attestation('', '', '', 'JWT', '', null, []);
 
-    if (this.newIdProvider.url !== ''){
-      
this.oauthService.configure(this.attestationService.getOauthConfig(this.newIdProvider));
-      this.oauthService.loadDiscoveryDocumentAndTryLogin();
-    }
 
     if (undefined !== this.activatedRoute.snapshot.queryParams["experiments"]) 
{
       this.setExperimental("true" === 
this.activatedRoute.snapshot.queryParams["experiments"]);
@@ -634,7 +630,6 @@ export class EditIdentityComponent implements OnInit {
   }
 
   discoverIdProvider() {
-    this.logOutFromOauthService();
     if (this.webfingerEmail == ''){
       return;
     }
@@ -677,24 +672,6 @@ export class EditIdentityComponent implements OnInit {
     return url.split('//')[1];
   }
 
-  loginFhgAccount(){
-    var authCodeFlowConfig = 
this.attestationService.getOauthConfig(this.newIdProvider);
-    this.oauthService.configure(authCodeFlowConfig);
-    this.oauthService.loadDiscoveryDocumentAndLogin();
-    this.getId();
-  }
-
-  getId (): any{
-    return this.oauthService.getIdentityClaims();
-  }
-
-  grantedAccessToIdProvider(){
-    if (this.oauthService.hasValidAccessToken()){
-      return true;
-    };
-    return false;
-  }
-
   loadIdProviderFromLocalStorage(){
     this.newIdProvider.url = localStorage.getItem("newIdProviderURL") || '';
     this.newIdProvider.name = 
this.getNewIdProviderName(this.newIdProvider.url);
@@ -729,15 +706,14 @@ export class EditIdentityComponent implements OnInit {
     });
   }
 
-  logOutFromOauthService(){
-    if (!this.oauthService.hasValidAccessToken()){
-      return;
-    }
-    this.oauthService.logOut(false);
+  loginFhgAccount(){
+    var authCodeFlowConfig = 
this.attestationService.getOauthConfig(this.newIdProvider);
+    this.oauthService.configure(authCodeFlowConfig);
+    this.oauthService.loadDiscoveryDocumentAndLogin();
   }
 
+
   cancelLinking(){
-    this.logOutFromOauthService();
     this.resetNewIdProvider();
     this.webfingerEmail = '';
   }
@@ -750,28 +726,6 @@ export class EditIdentityComponent implements OnInit {
     localStorage.removeItem('newIdProviderLogoutURL')
   }
 
-  getAttestationExpiration(){
-    return this.oauthService.getIdTokenExpiration()
-  }
-
-  getAttestationAttributes(): Attribute[]{
-    var attestationAttributes: Attribute [] = [];
-    const attributesObject = this.getId();
-    Object.keys(attributesObject).forEach (attributeKey => {
-      console.log(attributeKey);
-      var tempAttribute: Attribute = {
-        name: attributeKey,
-        id: this.newIdProvider.url, //Don't think this is correct id
-        attestation: this.newIdProvider.url,
-        value: attributesObject[attributeKey],
-        type: 'STRING',
-        flag: '1',
-      }
-      attestationAttributes.push(tempAttribute);
-    });
-    return attestationAttributes;
-  }
-
   setExperimental(set) {
     if (set) {
       localStorage.setItem('reclaimExperiments', 'enabled');

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