middleware: prevent passive authentication on ajax requests (#34781)

This commit is contained in:
Benjamin Dauvergne 2019-07-12 12:12:15 +02:00
parent ab92ca9a07
commit 80074ea201
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,9 @@ class PassiveAuthenticationMiddleware(object):
return response
def process_view(self, request, view_func, view_args, view_kwargs):
# Skip AJAX requests
if request.is_ajax():
return
# Skip views asking to be skiped
if getattr(view_func, 'mellon_no_passive', False):
return