Skip to content

Commit

Permalink
fix 'next_url' params ^^'
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Dec 10, 2024
1 parent 156f4b7 commit 0cbc1ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions itou/openid_connect/pro_connect/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def process_request(self, request):
try:
user = User.objects.get(username=username[0], identity_provider=IdentityProvider.PRO_CONNECT.value)
return HttpResponseRedirect(
reverse("pro_connect:authorize") + f"?user_kind={user.kind}&previous_url={new_url}"
reverse("pro_connect:authorize") + f"?user_kind={user.kind}&next_url={new_url}"
)
except User.DoesNotExist:
return HttpResponseRedirect(reverse("signup:choose_user_kind") + f"?previous_url={new_url}")
return HttpResponseRedirect(reverse("signup:choose_user_kind") + f"?next_url={new_url}")
4 changes: 2 additions & 2 deletions tests/openid_connect/pro_connect/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_middlware_for_non_proconnect_user(client, db, params, expected_params):
response = client.get(f"/{params}{username_param}")
assertRedirects(
response,
f"{reverse('signup:choose_user_kind')}?previous_url=/{expected_params}",
f"{reverse('signup:choose_user_kind')}?next_url=/{expected_params}",
fetch_redirect_response=False,
)

Expand All @@ -59,6 +59,6 @@ def test_middleware_for_unlogged_proconnect_user(client, db, params, expected_pa
response = client.get(f"/{params}&username={user.username}")
assertRedirects(
response,
f"{reverse("pro_connect:authorize")}?user_kind={user.kind}&previous_url=/{expected_params}",
f"{reverse("pro_connect:authorize")}?user_kind={user.kind}&next_url=/{expected_params}",
fetch_redirect_response=False,
)

0 comments on commit 0cbc1ab

Please sign in to comment.