Skip to content

Commit

Permalink
Don't have an authenticatication loop
Browse files Browse the repository at this point in the history
When we want to access to the admin interface with oidc and with a user
that's not allowed to access to the admin interface.
  • Loading branch information
sbrunner committed Dec 18, 2024
1 parent f9c7b1b commit 31a32fa
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 31a32fa

Please sign in to comment.