diff --git a/InvenTree/InvenTree/middleware.py b/InvenTree/InvenTree/middleware.py index 3480ef0dbb..ea0d6ddc2a 100644 --- a/InvenTree/InvenTree/middleware.py +++ b/InvenTree/InvenTree/middleware.py @@ -155,6 +155,7 @@ class QueryCountMiddleware(object): url_matcher = url('', include(frontendpatterns)) + class Check2FAMiddleware(BaseRequire2FAMiddleware): """check if user is required to have MFA enabled""" def require_2fa(self, request): @@ -166,6 +167,7 @@ class Check2FAMiddleware(BaseRequire2FAMiddleware): pass return False + class CustomAllauthTwoFactorMiddleware(AllauthTwoFactorMiddleware): """This function ensures only frontend code triggers the MFA auth cycle""" def process_request(self, request): diff --git a/InvenTree/InvenTree/views.py b/InvenTree/InvenTree/views.py index 2ed17fe729..00f38ce89d 100644 --- a/InvenTree/InvenTree/views.py +++ b/InvenTree/InvenTree/views.py @@ -29,7 +29,6 @@ from allauth.socialaccount.forms import DisconnectForm from allauth.account.models import EmailAddress from allauth.account.views import EmailView, PasswordResetFromKeyView from allauth.socialaccount.views import ConnectionsView -from allauth_2fa.views import TwoFactorAuthenticate from common.settings import currency_code_default, currency_codes @@ -778,7 +777,6 @@ class CustomPasswordResetFromKeyView(PasswordResetFromKeyView): success_url = reverse_lazy("account_login") - class CurrencyRefreshView(RedirectView): """ POST endpoint to refresh / update exchange rates