From 81fb0a108ec0576da9ec0d7365a8e15d6f1124d2 Mon Sep 17 00:00:00 2001 From: Luis Alvergue Date: Tue, 21 May 2024 21:23:59 +0000 Subject: [PATCH] refactor(oauth): update view to handle integer claims --- benefits/oauth/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benefits/oauth/views.py b/benefits/oauth/views.py index 86db149fe5..48ad2a979b 100644 --- a/benefits/oauth/views.py +++ b/benefits/oauth/views.py @@ -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)