diff --git a/InvenTree/InvenTree/middleware.py b/InvenTree/InvenTree/middleware.py
index 1f8fcf7830..8a2c0b17a4 100644
--- a/InvenTree/InvenTree/middleware.py
+++ b/InvenTree/InvenTree/middleware.py
@@ -63,7 +63,7 @@ class AuthRequiredMiddleware(object):
 
             # No authorization was found for the request
             if not authorized:
-                if not request.path_info == reverse_lazy('login') and not request.path_info == '/api/':
+                if not request.path_info == reverse_lazy('login') and not request.path_info.startswith('/api/'):
                     return HttpResponseRedirect(reverse_lazy('login'))
 
         # Code to be executed for each request/response after