mirror of
https://github.com/smittix/intercept.git
synced 2026-05-27 02:04:45 -07:00
Add flask-limiter dependency and allow /health without login
This commit is contained in:
8
app.py
8
app.py
@@ -203,9 +203,9 @@ cleanup_manager.register(dsc_messages)
|
||||
# ============================================
|
||||
|
||||
@app.before_request
|
||||
def require_login():
|
||||
# Routes that don't require login (to avoid infinite redirect loop)
|
||||
allowed_routes = ['login', 'static', 'favicon', 'health']
|
||||
def require_login():
|
||||
# Routes that don't require login (to avoid infinite redirect loop)
|
||||
allowed_routes = ['login', 'static', 'favicon', 'health', 'health_check']
|
||||
|
||||
# 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:
|
||||
@@ -710,4 +710,4 @@ def main() -> None:
|
||||
debug=args.debug,
|
||||
threaded=True,
|
||||
load_dotenv=False,
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user