From 743aaea15e420879d0e23c6e5216e042b6e3045a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 2 Mar 2021 15:04:31 +0100 Subject: [PATCH] policies: improve logging --- authentik/api/pagination.py | 1 + authentik/policies/views.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/authentik/api/pagination.py b/authentik/api/pagination.py index 42a5249ec..04bfefd1e 100644 --- a/authentik/api/pagination.py +++ b/authentik/api/pagination.py @@ -6,6 +6,7 @@ from rest_framework.response import Response class Pagination(pagination.PageNumberPagination): """Pagination which includes total pages and current page""" + page_query_param = "page" page_size_query_param = "page_size" def get_paginated_response(self, data): diff --git a/authentik/policies/views.py b/authentik/policies/views.py index c40454b9d..c4a0fae49 100644 --- a/authentik/policies/views.py +++ b/authentik/policies/views.py @@ -63,10 +63,12 @@ class PolicyAccessView(AccessMixin, View): try: self.resolve_provider_application() except (Application.DoesNotExist, Provider.DoesNotExist): + LOGGER.warning("failed to resolve application") return self.handle_no_permission_authenticated() # Check if user is unauthenticated, so we pass the application # for the identification stage if not request.user.is_authenticated: + LOGGER.warning("user not authenticated") return self.handle_no_permission() # Check permissions result = self.user_has_access()