Skip to content

Commit

Permalink
refactor(oauth): update view to handle integer claims
Browse files Browse the repository at this point in the history
  • Loading branch information
lalver1 committed May 24, 2024
1 parent 240e211 commit 81fb0a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions benefits/oauth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ def authorize(request):

if userinfo:
claim_value = userinfo.get(verifier_claim)
# the claim comes back in userinfo like { "claim": "True" | "False" }
# the claim comes back in userinfo like { "claim": "1" | "0" }
if claim_value is None:
logger.warning(f"userinfo did not contain: {verifier_claim}")
elif claim_value.lower() == "true":
# if userinfo contains our claim and the flag is true, store the *claim*
elif int(claim_value) == 1:
# if userinfo contains our claim and the flag is 1 (true), store the *claim*
stored_claim = verifier_claim

session.update(request, oauth_token=id_token, oauth_claim=stored_claim)
Expand Down

0 comments on commit 81fb0a1

Please sign in to comment.