run middleware after authentication

This commit is contained in:
Include caleb.fun 2023-05-12 08:59:06 +01:00 committed by GitHub
parent 0e973b9953
commit 2359ae86ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -430,11 +430,11 @@ class APIView(View):
# Ensure that the incoming request is permitted # Ensure that the incoming request is permitted
self.perform_authentication(request) self.perform_authentication(request)
# only authentication before, other task ran after mutation
self.initialize_middleware_classes(request)
self.check_permissions(request) self.check_permissions(request)
self.check_throttles(request) self.check_throttles(request)
# authentication and other task ran before final mutation
self.initialize_middleware_classes(request)
def finalize_response(self, request, response, *args, **kwargs): def finalize_response(self, request, response, *args, **kwargs):
""" """