Skip to content

Commit 6a502ab

Browse files
committed
undid change
1 parent 0110265 commit 6a502ab

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

backend/app/middleware/auth_middleware.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ def __init__(self, app: ASGIApp, public_paths: List[str] = None):
1717
self.logger = logging.getLogger(LOGGER_NAME("auth_middleware"))
1818

1919
def is_public_path(self, path: str) -> bool:
20-
return True
21-
# for public_path in self.public_paths:
22-
# # Handle parameterized routes by checking if path starts with the pattern
23-
# if public_path.endswith("{email}") and path.startswith(public_path.replace("{email}", "")):
24-
# return True
25-
# # Exact match for non-parameterized routes
26-
# if path == public_path:
27-
# return True
28-
# return False
20+
for public_path in self.public_paths:
21+
# Handle parameterized routes by checking if path starts with the pattern
22+
if public_path.endswith("{email}") and path.startswith(public_path.replace("{email}", "")):
23+
return True
24+
# Exact match for non-parameterized routes
25+
if path == public_path:
26+
return True
27+
return False
2928

3029
async def dispatch(self, request: Request, call_next):
3130
# Allow preflight CORS requests to pass through without auth

0 commit comments

Comments
 (0)