gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 252/459: minor fix


From: gnunet
Subject: [reclaim-ui] 252/459: minor fix
Date: Fri, 11 Jun 2021 23:25:44 +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 9537e165c48a29b332304a173abcf51d2030d432
Author: Martin Schanzenbach <mschanzenbach@posteo.de>
AuthorDate: Mon Aug 3 13:20:24 2020 +0200

    minor fix
---
 src/app/open-id.service.ts | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/src/app/open-id.service.ts b/src/app/open-id.service.ts
index cf384f8..2c3136a 100644
--- a/src/app/open-id.service.ts
+++ b/src/app/open-id.service.ts
@@ -64,15 +64,34 @@ export class OpenIdService {
     this.inOidcFlow = this.params['redirect_uri'] !== undefined;
   }
 
+  private buildAuthorizeRedirect(): any {
+    var redirectUri = this.config.get().apiUrl + '/openid/authorize';
+    redirectUri += '?client_id=' + this.params['client_id'];
+    redirectUri += '&redirect_uri=' + this.params['redirect_uri'];
+    redirectUri += '&response_type=' + this.params['response_type'];
+    redirectUri += '&scope=' + this.params['scope'];
+    if (this.referenceString !== "")
+    {
+      redirectUri += " " + this.referenceString;
+    }
+    if (this.params['state'] !== undefined)
+    {
+      redirectUri += '&state=' + this.params['state'];
+    }
+    if (this.params['code_challenge'] !== undefined)
+    {
+      redirectUri += '&code_challenge=' + this.params['code_challenge'];
+    }
+    if (this.params['nonce'] !== undefined)
+    {
+      redirectUri += '&nonce=' + this.params['nonce'];
+    }
+    return redirectUri;
+  }
+
   authorize(): any {
     this.inOidcFlow = false;
-    window.location.href = this.config.get().apiUrl + 
'/openid/authorize?client_id=' + this.params['client_id'] +
-    '&redirect_uri=' + this.params['redirect_uri'] +
-    '&response_type=' + this.params['response_type'] +
-    '&scope=' + this.params['scope'] + " " + this.referenceString +
-    '&state=' + this.params['state'] +
-    '&code_challenge=' + this.params['code_challenge'] +
-    '&nonce=' + this.params['nonce'];
+    window.location.href = this.buildAuthorizeRedirect();
   }
 
   setAttestations(attestations: Attribute[]) {
@@ -111,7 +130,9 @@ export class OpenIdService {
     }
 
     const scopes = this.params['scope'].split(' ');
-    const i = scopes.indexOf('openid');
+    var i = scopes.indexOf('openid');
+    scopes.splice(i, 1);
+    i = scopes.indexOf('profile');
     scopes.splice(i, 1);
     return scopes;
   }

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