We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 49c80f1 commit 4cba7ccCopy full SHA for 4cba7cc
authentication/views.py
@@ -5,6 +5,7 @@
5
from django.conf import settings
6
from django.contrib.auth import views
7
from django.shortcuts import redirect
8
+from social_core.utils import sanitize_redirect
9
from social_django.utils import load_strategy
10
11
from authentication.backends.ol_open_id_connect import OlOpenIdConnectAuth
@@ -34,6 +35,9 @@ def _keycloak_logout_url(self, user):
34
35
).first()
36
id_token = user_social_auth_record.extra_data.get("id_token")
37
qs_next = self.request.GET.get("next")
38
+ if qs_next:
39
+ allowed_hosts = settings.SOCIAL_AUTH_ALLOWED_REDIRECT_HOSTS or []
40
+ qs_next = sanitize_redirect(allowed_hosts, qs_next)
41
qs = urlencode(
42
{
43
"id_token_hint": id_token,
0 commit comments