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 440f12d commit b2e06b2Copy full SHA for b2e06b2
allauth/account/adapter.py
@@ -587,6 +587,13 @@ def is_safe_url(self, url):
587
# get_host already validates the given host, so no need to check it again
588
allowed_hosts = {context.request.get_host()} | set(settings.ALLOWED_HOSTS)
589
590
+ # Include hosts derived from CSRF_TRUSTED_ORIGINS
591
+ trusted_hosts = {
592
+ urlparse(origin).netloc for origin in settings.CSRF_TRUSTED_ORIGINS
593
+ }
594
+ allowed_hosts.update(trusted_hosts)
595
+
596
+ # Handle wildcard case
597
if "*" in allowed_hosts:
598
parsed_host = urlparse(url).netloc
599
allowed_host = {parsed_host} if parsed_host else None
0 commit comments