Skip to content

Commit

Permalink
Merge pull request #11598 from camptocamp/auth-loop
Browse files Browse the repository at this point in the history
Don't have an authenticatication loop
  • Loading branch information
sbrunner authored Dec 18, 2024
2 parents 315a5d9 + 8084ce2 commit 2cf265f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geoportal/c2cgeoportal_geoportal/views/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def _referrer_log(self) -> None:

@forbidden_view_config(renderer="login.html") # type: ignore[misc]
def loginform403(self) -> dict[str, Any] | pyramid.response.Response:
if self.request.authenticated_userid is not None:
return HTTPForbidden()

if self.authentication_settings.get("openid_connect", {}).get("enabled", False):
return HTTPFound(
location=self.request.route_url(
Expand All @@ -101,9 +104,6 @@ def loginform403(self) -> dict[str, Any] | pyramid.response.Response:
)
)

if self.request.authenticated_userid is not None:
return HTTPForbidden()

set_common_headers(self.request, "login", Cache.PRIVATE_NO)

return {
Expand Down

0 comments on commit 2cf265f

Please sign in to comment.