From 2c10fc03a56d9a7cd5e24ea4124646a835c444ce Mon Sep 17 00:00:00 2001 From: zjean Date: Sat, 13 Apr 2024 17:19:17 +0200 Subject: [PATCH] Exclude /api from PROXY forward auth (#790) * Update middleware.py * Fix gulp * Call super() * Fix comment formatting * Super duper --------- Co-authored-by: Christopher Charbonneau Wells <10456740+cdubz@users.noreply.github.com> --- babybuddy/middleware.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/babybuddy/middleware.py b/babybuddy/middleware.py index e07039eb..2aacc890 100644 --- a/babybuddy/middleware.py +++ b/babybuddy/middleware.py @@ -91,6 +91,12 @@ class CustomRemoteUser(RemoteUserMiddleware): header = getenv("PROXY_HEADER", "HTTP_REMOTE_USER") + def process_request(self, request): + # Exclude API paths using token authentication. + if request.path.startswith("api/"): + return None + return super().process_request(request) + class HomeAssistant: """