mirror of
https://github.com/smittix/intercept.git
synced 2026-07-16 05:18:10 -07:00
Add flask-limiter dependency and allow /health without login
This commit is contained in:
@@ -203,9 +203,9 @@ cleanup_manager.register(dsc_messages)
|
|||||||
# ============================================
|
# ============================================
|
||||||
|
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def require_login():
|
def require_login():
|
||||||
# Routes that don't require login (to avoid infinite redirect loop)
|
# Routes that don't require login (to avoid infinite redirect loop)
|
||||||
allowed_routes = ['login', 'static', 'favicon', 'health']
|
allowed_routes = ['login', 'static', 'favicon', 'health', 'health_check']
|
||||||
|
|
||||||
# If user is not logged in and the current route is not allowed...
|
# If user is not logged in and the current route is not allowed...
|
||||||
if 'logged_in' not in session and request.endpoint not in allowed_routes:
|
if 'logged_in' not in session and request.endpoint not in allowed_routes:
|
||||||
@@ -710,4 +710,4 @@ def main() -> None:
|
|||||||
debug=args.debug,
|
debug=args.debug,
|
||||||
threaded=True,
|
threaded=True,
|
||||||
load_dotenv=False,
|
load_dotenv=False,
|
||||||
)
|
)
|
||||||
|
|||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
# Core dependencies
|
# Core dependencies
|
||||||
flask>=2.0.0
|
flask>=2.0.0
|
||||||
flask-limiter>=2.5.4
|
requests>=2.28.0
|
||||||
requests>=2.28.0
|
flask-limiter
|
||||||
Werkzeug>=3.1.5
|
psycopg2-binary>=2.9.9
|
||||||
|
|
||||||
# BLE scanning with manufacturer data detection (optional - for TSCM)
|
# BLE scanning with manufacturer data detection (optional - for TSCM)
|
||||||
bleak>=0.21.0
|
bleak>=0.21.0
|
||||||
|
|||||||
Reference in New Issue
Block a user