dev #60

Merged
sbcrumb merged 42 commits from dev into main 2025-10-22 21:27:04 -04:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 296e668db6 - Show all commits
+2 -2
View File
@@ -72,10 +72,10 @@ class AuthSession:
class SimpleAuthMiddleware(BaseHTTPMiddleware):
"""Simple authentication middleware for web interface routes"""
def __init__(self, app, config):
def __init__(self, app, config, session_manager=None):
super().__init__(app)
self.config = config
self.session_manager = AuthSession(config.web_auth_session_timeout)
self.session_manager = session_manager or AuthSession(config.web_auth_session_timeout)
self.security = HTTPBasic()
# Routes that require authentication (web interface)
+2 -1
View File
@@ -129,7 +129,8 @@ def main():
# Add authentication middleware if enabled (BEFORE routes)
if auth_enabled:
app.add_middleware(SimpleAuthMiddleware, config=config)
# Pass the session manager to middleware so it uses the same instance
app.add_middleware(SimpleAuthMiddleware, config=config, session_manager=session_manager)
print("🔐 Authentication middleware added to web interface")
# Setup static files and routes