mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-15 17:17:02 +02:00
Fix missing client_id during logout
This commit is contained in:
parent
6880684dd6
commit
94800bc00a
2 changed files with 3 additions and 4 deletions
|
@ -81,7 +81,6 @@ class ViewsTest(TestCase):
|
||||||
def test_logout_redirect_url(self, mock_client):
|
def test_logout_redirect_url(self, mock_client):
|
||||||
# setup
|
# setup
|
||||||
session = self.client.session
|
session = self.client.session
|
||||||
session["id_token_raw"] = "TEST" # nosec B105
|
|
||||||
session["state"] = "TEST" # nosec B105
|
session["state"] = "TEST" # nosec B105
|
||||||
session.save()
|
session.save()
|
||||||
# mock
|
# mock
|
||||||
|
@ -92,12 +91,13 @@ class ViewsTest(TestCase):
|
||||||
mock_client.provider_info = {
|
mock_client.provider_info = {
|
||||||
"end_session_endpoint": "http://example.com/log_me_out"
|
"end_session_endpoint": "http://example.com/log_me_out"
|
||||||
}
|
}
|
||||||
|
mock_client.client_id = "TEST"
|
||||||
# test
|
# test
|
||||||
with less_console_noise():
|
with less_console_noise():
|
||||||
response = self.client.get(reverse("logout"))
|
response = self.client.get(reverse("logout"))
|
||||||
# assert
|
# assert
|
||||||
expected = (
|
expected = (
|
||||||
"http://example.com/log_me_out?id_token_hint=TEST&state"
|
"http://example.com/log_me_out?client_id=TEST&state"
|
||||||
"=TEST&post_logout_redirect_uri=http%3A%2F%2Fexample.com%2Fback"
|
"=TEST&post_logout_redirect_uri=http%3A%2F%2Fexample.com%2Fback"
|
||||||
)
|
)
|
||||||
actual = response.url
|
actual = response.url
|
||||||
|
|
|
@ -84,8 +84,7 @@ def logout(request, next_page=None):
|
||||||
try:
|
try:
|
||||||
username = request.user.username
|
username = request.user.username
|
||||||
request_args = {
|
request_args = {
|
||||||
# it is perfectly fine to send the token, even if it is expired
|
"client_id": CLIENT.client_id,
|
||||||
"id_token_hint": request.session["id_token_raw"],
|
|
||||||
"state": request.session["state"],
|
"state": request.session["state"],
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue