[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-ui] 197/459: link to fhg account
From: |
gnunet |
Subject: |
[reclaim-ui] 197/459: link to fhg account |
Date: |
Fri, 11 Jun 2021 23:24:49 +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 f21dd73bb5d61890fd522bb77b190cd20f06e4b7
Author: anna wimbauer <anna.wibauer@gmx.de>
AuthorDate: Mon May 18 14:41:31 2020 +0200
link to fhg account
---
src/app/edit-identity/edit-identity.component.html | 10 ++++++++--
src/app/edit-identity/edit-identity.component.ts | 23 +++++++++++++++++++---
src/app/id-provider.ts | 11 -----------
3 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/src/app/edit-identity/edit-identity.component.html
b/src/app/edit-identity/edit-identity.component.html
index beeedf5..80016f2 100644
--- a/src/app/edit-identity/edit-identity.component.html
+++ b/src/app/edit-identity/edit-identity.component.html
@@ -142,7 +142,8 @@
</ul>
</div>
- <div class="input-group my-2 col-lg-4">
+ <!--IdProvider-Discovery-->
+ <div *ngIf="!idProviderFound()" class="input-group my-2 col-lg-4">
<div class="input-group-prepend">
<span class="input-group-text">@</span>
</div>
@@ -156,10 +157,15 @@
<div *ngIf="!emailNotFoundAlertClosed" class="alert alert-danger
alert-dismissible fade show my-2" role="alert">
<span class="fa fa-warning"></span> No account found with email:
{{webfingerEmail}}
</div>
- <button *ngIf="isExperimental()" class="btn btn-primary mb-4 fhg-link"
(click)="getFhGAttestation()">
+ <button *ngIf="isExperimental() && !idProviderFound()" class="btn
btn-primary mb-4 fhg-link" (click)="getFhGAttestation()">
<span class="fa fa-user"></span> Link Fraunhofer Account
</button>
+ <!--Link account-->
+ <button *ngIf="isExperimental() && idProviderFound()" class="btn
btn-primary mb-4 fhg-link" (click)="loginFhgAccount()">
+ <span class="fa fa-user"></span> Link {{getIdProviderName()}} Account
+ </button>
+
<hr/>
diff --git a/src/app/edit-identity/edit-identity.component.ts
b/src/app/edit-identity/edit-identity.component.ts
index 5a71fe4..811bf20 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -11,7 +11,6 @@ import { IdentityService } from '../identity.service';
import { finalize } from 'rxjs/operators';
import { from, forkJoin, EMPTY } from 'rxjs';
import {WebfingerService} from '../webfinger.service';
-import { IdProvider } from '../id-provider'
@Component({
selector: 'app-edit-identity',
@@ -32,7 +31,7 @@ export class EditIdentityComponent implements OnInit {
requestedAttested: Attribute[];
optionalAttested: Attribute[];
webfingerEmail: string;
- idProvider: IdProvider;
+ idProvider: string;
emailNotFoundAlertClosed: boolean;
constructor(private reclaimService: ReclaimService,
@@ -50,6 +49,7 @@ export class EditIdentityComponent implements OnInit {
this.optionalAttested = [];
this.attestationValues = {};
this.webfingerEmail = '';
+ this.idProvider = localStorage.getItem('idProvider');
this.emailNotFoundAlertClosed = true;
this.identity = new Identity('','');
this.newAttribute = new Attribute('', '', '', '', 'STRING', '');
@@ -624,7 +624,9 @@ export class EditIdentityComponent implements OnInit {
localStorage.setItem('userForAttestation', this.identity.name);
this.isValidEmailforDiscovery();
this.webfingerService.getLink(this.webfingerEmail).subscribe (idProvider
=> {
- this.idProvider = idProvider;
+ this.idProvider = (idProvider.links [0]).href;
+ localStorage.setItem('idProvider', this.idProvider);
+ console.log(this.idProvider);
},
error => {
if (error.status == 404){
@@ -643,6 +645,21 @@ export class EditIdentityComponent implements OnInit {
return true;
}
+ idProviderFound(){
+ if (this.idProvider == null){
+ return false;
+ }
+ return true;
+ }
+
+ getIdProviderName(){
+ return this.idProvider.split('//')[1];
+ }
+
+ loginFhgAccount(){
+ window.location.href= this.idProvider + '/api/login';
+ }
+
setExperimental(set) {
if (set) {
localStorage.setItem('reclaimExperiments', 'enabled');
diff --git a/src/app/id-provider.ts b/src/app/id-provider.ts
deleted file mode 100644
index 77912e1..0000000
--- a/src/app/id-provider.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export interface IdProvider{
- subject: string;
- properties: {
- "http://schema.org/name": string;
- }
- links: {
- rel: string;
- href: string;
- }
-
-}
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-ui] 183/459: hack constant attestation button against local IdP, (continued)
- [reclaim-ui] 183/459: hack constant attestation button against local IdP, gnunet, 2021/06/11
- [reclaim-ui] 165/459: minor fixes, gnunet, 2021/06/11
- [reclaim-ui] 173/459: various fixed and improvements, gnunet, 2021/06/11
- [reclaim-ui] 199/459: Merge branch 'master' of gitlab.com:reclaimid/ui, gnunet, 2021/06/11
- [reclaim-ui] 172/459: manual merge from https://gitlab.com/voggenre/ui due to refactoring, gnunet, 2021/06/11
- [reclaim-ui] 169/459: display name correctly, gnunet, 2021/06/11
- [reclaim-ui] 194/459: fix attest parsing, gnunet, 2021/06/11
- [reclaim-ui] 174/459: fix build, gnunet, 2021/06/11
- [reclaim-ui] 177/459: fix getter, gnunet, 2021/06/11
- [reclaim-ui] 168/459: actually initiate verify, gnunet, 2021/06/11
- [reclaim-ui] 197/459: link to fhg account,
gnunet <=
- [reclaim-ui] 167/459: more refactoring and cleanup, gnunet, 2021/06/11
- [reclaim-ui] 175/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 181/459: actually fix reference name display, gnunet, 2021/06/11
- [reclaim-ui] 200/459: webfinger, gnunet, 2021/06/11
- [reclaim-ui] 170/459: update dependencies, gnunet, 2021/06/11
- [reclaim-ui] 205/459: login via omejdn:api works, gnunet, 2021/06/11
- [reclaim-ui] 185/459: minor fixes, gnunet, 2021/06/11
- [reclaim-ui] 206/459: attestation name added, gnunet, 2021/06/11
- [reclaim-ui] 186/459: update to new API and structure, gnunet, 2021/06/11
- [reclaim-ui] 208/459: store idProvider/Attestation(not working), gnunet, 2021/06/11