Skip to content

Commit

Permalink
[fix] Fix "Location" header access: convert the list of tuples to a d…
Browse files Browse the repository at this point in the history
…ictionary for correct access (#21)

Co-authored-by: Vincent, Jean <[email protected]>
  • Loading branch information
jean-sh and Vincent, Jean authored Dec 6, 2021
1 parent dbc0d0a commit 409fc90
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions django_saml2_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,7 @@ def signin(request: HttpRequest):
saml_client = get_saml_client(get_assertion_url(request), acs)
_, info = saml_client.prepare_for_authenticate(relay_state=next_url)

redirect_url = None

if "Location" in info["headers"]:
redirect_url = info["headers"]["Location"]

redirect_url = dict(info["headers"]).get("Location", "")
return HttpResponseRedirect(redirect_url)


Expand Down

0 comments on commit 409fc90

Please sign in to comment.