Skip to content

Commit

Permalink
Also handle empty (non-null) claim values when building displayname
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Sep 5, 2024
1 parent a80ed33 commit b1b73e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ def login():
# Verify login
userid = next(claims[userid_claim] for userid_claim in config.get("userid_claims", []) if claims.get(userid_claim))
toarray = lambda x: [x] if isinstance(x, str) else x
displayname = next(
displayname = next((
" ".join(list(map(lambda x: claims.get(x), toarray(displayname_claim))))
for displayname_claim in config.get("displayname_claims", [])
if None not in list(map(lambda x: claims.get(x), toarray(displayname_claim)))
if False not in list(map(lambda x: bool(claims.get(x)), toarray(displayname_claim)))), ""
)
app.logger.debug("userid: %s, displayname: %s" % (userid, displayname))

Expand Down

0 comments on commit b1b73e0

Please sign in to comment.