Skip to content

Commit

Permalink
inherit from MiddlewareMixin
Browse files Browse the repository at this point in the history
gives async compatibility for free
  • Loading branch information
xi committed Sep 18, 2023
1 parent 72a5937 commit 8825744
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions mfa/middleware.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
from django.shortcuts import redirect
from django.utils.deprecation import MiddlewareMixin


class MFAEnforceMiddleware:
def __init__(self, get_response):
self.get_response = get_response

def __call__(self, request):
return self.get_response(request)

class MFAEnforceMiddleware(MiddlewareMixin):
def process_view(self, request, view_func, view_args, view_kwargs):
if (
not getattr(view_func, 'mfa_public', False)
Expand Down

0 comments on commit 8825744

Please sign in to comment.