Skip to content

Commit

Permalink
feat(oauth): add optional error_code to authorize view
Browse files Browse the repository at this point in the history
  • Loading branch information
lalver1 committed Jun 3, 2024
1 parent 1bdd596 commit b67a7b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions benefits/oauth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def authorize(request):
verifier_claim = verifier.auth_provider.claim
stored_claim = None

error_claim = None

if verifier_claim:
userinfo = token.get("userinfo")

Expand All @@ -76,10 +78,11 @@ def authorize(request):
elif claim_value == 1:
# if userinfo contains our claim and the flag is 1 (true), store the *claim*
stored_claim = verifier_claim
elif claim_value >= 10:
error_claim = claim_value

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

analytics.finished_sign_in(request)
analytics.finished_sign_in(request, error=error_claim)

return redirect(ROUTE_CONFIRM)

Expand Down

0 comments on commit b67a7b1

Please sign in to comment.