# HG changeset patch # User Goffi # Date 1618591217 -7200 # Node ID 3dff555fe6915abadf72a3b87ba73b1ccdfa9df2 # Parent 6a35167a4e2ca91f9ec0625c8c4100e4bd932b39 pages: do no send HTTP_FORBIDDEN when registration is not allowed and no profile is connected: if registration is not allowed, an existing user may still want to log in. diff -r 6a35167a4e2c -r 3dff555fe691 libervia/server/pages.py --- a/libervia/server/pages.py Fri Apr 16 18:38:45 2021 +0200 +++ b/libervia/server/pages.py Fri Apr 16 18:40:17 2021 +0200 @@ -1668,14 +1668,9 @@ elif self.access == C.PAGES_ACCESS_PROFILE: profile = self.getProfile(request) if not profile: - # no session started - if not self.host.options["allow_registration"]: - # registration not allowed, access is not granted - self.pageError(request, C.HTTP_FORBIDDEN) - else: - # registration allowed, we redirect to login page - login_url = self.getPageRedirectURL(request) - self.HTTPRedirect(request, login_url) + # registration allowed, we redirect to login page + login_url = self.getPageRedirectURL(request) + self.HTTPRedirect(request, login_url) def setBestLocale(self, request): """Guess the best locale when it is not specified explicitly by user