fix serwowanie toasts.js i error handlery
This commit is contained in:
5
app.py
5
app.py
@@ -252,6 +252,9 @@ def inject_has_authorized_cookie():
|
||||
|
||||
@app.before_request
|
||||
def require_system_password():
|
||||
if request.endpoint is None:
|
||||
return
|
||||
|
||||
if 'authorized' not in request.cookies \
|
||||
and request.endpoint != 'system_auth' \
|
||||
and not request.endpoint.startswith('login') \
|
||||
@@ -259,6 +262,8 @@ def require_system_password():
|
||||
|
||||
if request.endpoint == 'static_bp.serve_js':
|
||||
requested_file = request.view_args.get("filename", "")
|
||||
if requested_file == "toasts.js":
|
||||
return
|
||||
if requested_file.endswith(".js"):
|
||||
return redirect(url_for('system_auth', next=request.url))
|
||||
else:
|
||||
|
Reference in New Issue
Block a user