auth: Pass None as default_subdomain to verify the host.

We were not verifying correctly if the host is in the same
subdomain as we never returned None for get_subdomain_from_hostname.
This commit is contained in:
Aman Agrawal
2025-07-28 11:33:55 +05:30
committed by Tim Abbott
parent 5616be4afa
commit f4dd3aa066
3 changed files with 10 additions and 8 deletions

View File

@@ -34,7 +34,7 @@ def get_subdomain_from_hostname(
m = re.search(rf"\.{settings.EXTERNAL_HOST}(:\d+)?$", host)
if m:
subdomain = host[: m.start()]
if subdomain in settings.ROOT_SUBDOMAIN_ALIASES:
if default_subdomain is not None and subdomain in settings.ROOT_SUBDOMAIN_ALIASES:
return default_subdomain
return subdomain