From 74ad1b675988e7407526ffff7b90a1d9770ecdae Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 18 Feb 2020 17:05:30 +0100 Subject: [PATCH] factors: strip port for domain check --- passbook/core/views/overview.py | 2 +- passbook/factors/view.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/passbook/core/views/overview.py b/passbook/core/views/overview.py index 54909f144..6185dce05 100644 --- a/passbook/core/views/overview.py +++ b/passbook/core/views/overview.py @@ -15,7 +15,7 @@ class OverviewView(LoginRequiredMixin, TemplateView): def get_context_data(self, **kwargs): kwargs["applications"] = [] - for application in Application.objects.all().order_by('name'): + for application in Application.objects.all().order_by("name"): engine = PolicyEngine( application.policies.all(), self.request.user, self.request ) diff --git a/passbook/factors/view.py b/passbook/factors/view.py index e3702a5a0..eee50cf64 100644 --- a/passbook/factors/view.py +++ b/passbook/factors/view.py @@ -53,6 +53,8 @@ class AuthenticationView(UserPassesTestMixin, View): """Checks if current request's domain matches configured Domain, and adds a warning if not.""" current_domain = self.request.get_host() + if ":" in current_domain: + current_domain, _ = current_domain.split(":") config_domain = CONFIG.y("domain") if current_domain != config_domain: message = (