tenants: fix tenant not being queried correctly when using accessing over a child domain
closes #1044 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -23,6 +23,25 @@ class TestTenants(TestCase):
|
||||
},
|
||||
)
|
||||
|
||||
def test_tenant_subdomain(self):
|
||||
"""Test Current tenant API"""
|
||||
Tenant.objects.all().delete()
|
||||
Tenant.objects.create(domain="bar.baz", branding_title="custom")
|
||||
self.assertJSONEqual(
|
||||
force_str(
|
||||
self.client.get(
|
||||
reverse("authentik_api:tenant-current"), HTTP_HOST="foo.bar.baz"
|
||||
).content
|
||||
),
|
||||
{
|
||||
"branding_logo": "/static/dist/assets/icons/icon_left_brand.svg",
|
||||
"branding_favicon": "/static/dist/assets/icons/icon.png",
|
||||
"branding_title": "custom",
|
||||
"matched_domain": "bar.baz",
|
||||
"ui_footer_links": CONFIG.y("authentik.footer_links"),
|
||||
},
|
||||
)
|
||||
|
||||
def test_fallback(self):
|
||||
"""Test fallback tenant"""
|
||||
Tenant.objects.all().delete()
|
||||
|
||||
Reference in New Issue
Block a user