Skip to content

Handle case where the frontend url already contains query parameters #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions django_saml2_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ def acs(request: HttpRequest):
if custom_frontend_url_trigger:
frontend_url = run_hook(custom_frontend_url_trigger, relay_state) # type: ignore

if "?" in frontend_url and not custom_token_query_trigger:
# There is already query params, so we need to include the token as an argument
# We also did not use a custom trigger.
query = f"&token={jwt_token}"

return HttpResponseRedirect(frontend_url + query)


Expand Down