gnunet-svn
[Top][All Lists]
Advanced

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

[reclaim-ui] 377/459: ignore some profile claims


From: gnunet
Subject: [reclaim-ui] 377/459: ignore some profile claims
Date: Fri, 11 Jun 2021 23:27: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 2e5e58ad6f906f0680d6c51129a2359e157e0891
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Fri Dec 25 22:31:22 2020 +0900

    ignore some profile claims
---
 src/app/open-id.service.ts | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/src/app/open-id.service.ts b/src/app/open-id.service.ts
index d3597e7..7f38cd9 100644
--- a/src/app/open-id.service.ts
+++ b/src/app/open-id.service.ts
@@ -179,19 +179,34 @@ export class OpenIdService {
 
   isClaimsMissing(attributes: Attribute[], claims: Object): boolean {
     for (let attr of attributes) {
+      var found = false;
       for (let claim in claims) {
-        /* if any attribute for profile exists, we are good */
         if (attr.name === claim) {
-          return false;
+          found = true;
         }
       }
+      if (!found) {
+        return true;
+      }
     }
-    return true;
+    return false;
   }
 
   isProfileMissing(attributes: Attribute[]): boolean {
     let profileClaims = this.getStandardProfileClaims();
-    return this.isClaimsMissing(attributes, profileClaims);
+    let claims = {};
+    for (let k in profileClaims) {
+      //Ignore clearly optional claims
+      if ((k === "nickname") ||
+          (k === "preferred_username") ||
+          (k === "picture") ||
+          (k === "website") ||
+          (k === "gender")) {
+        continue;
+      }
+      claims[k] = profileClaims[k];
+    }
+    return this.isClaimsMissing(attributes, claims);
   }
 
   isEmailMissing(attributes: Attribute[]): boolean {

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