[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.
- [reclaim-ui] 237/459: moved IdProvider-Linking to edit-attestations, (continued)
- [reclaim-ui] 237/459: moved IdProvider-Linking to edit-attestations, gnunet, 2021/06/11
- [reclaim-ui] 242/459: more style, gnunet, 2021/06/11
- [reclaim-ui] 217/459: fixed attestation-save (already existing attestations were always added again), gnunet, 2021/06/11
- [reclaim-ui] 222/459: omejdn:api scope deleted, gnunet, 2021/06/11
- [reclaim-ui] 227/459: redirect now to edit-attestations/clientname should be edit-identity/clientname #20, gnunet, 2021/06/11
- [reclaim-ui] 203/459: yarn.lock, gnunet, 2021/06/11
- [reclaim-ui] 234/459: adding attestation works, gnunet, 2021/06/11
- [reclaim-ui] 214/459: package.json, gnunet, 2021/06/11
- [reclaim-ui] 240/459: scopes after idProviderDiscovery, gnunet, 2021/06/11
- [reclaim-ui] 244/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 235/459: code duplicates removed,
gnunet <=
- [reclaim-ui] 251/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 259/459: fix attribute updates and display, gnunet, 2021/06/11
- [reclaim-ui] 243/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 257/459: minor wording change, gnunet, 2021/06/11
- [reclaim-ui] 248/459: minor info change, gnunet, 2021/06/11
- [reclaim-ui] 275/459: more info boxes, gnunet, 2021/06/11
- [reclaim-ui] 250/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 273/459: better requested claim handling, gnunet, 2021/06/11
- [reclaim-ui] 268/459: style, gnunet, 2021/06/11
- [reclaim-ui] 233/459: make discovery experimental, gnunet, 2021/06/11