Browse Source

minor fixes

master
Youen 2 years ago
parent
commit
9ffdc3712b
  1. 2
      src/app.py
  2. 2
      src/web/admin/admin.py

2
src/app.py

@ -31,7 +31,7 @@ def create_app():
if app.config['BEHIND_REVERSE_PROXY']: if app.config['BEHIND_REVERSE_PROXY']:
from werkzeug.middleware.proxy_fix import ProxyFix from werkzeug.middleware.proxy_fix import ProxyFix
app.wsgi_app = ProxyFix(app.wsgi_app) app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1)
from api import api_document from api import api_document
app.register_blueprint(api_document.bp) app.register_blueprint(api_document.bp)

2
src/web/admin/admin.py

@ -10,7 +10,7 @@ bp = Blueprint('admin', __name__, url_prefix='/admin')
@bp.before_app_request @bp.before_app_request
def authenticate(): def authenticate():
# Some views don't need authentication # Some views don't need authentication
if request.path == '/admin/login' or request.path.startswith('/doc/') or request.path == '/api/doc/build': if request.path == '/' or request.path == '/admin/login' or request.path.startswith('/doc/') or request.path == '/api/doc/build':
return return
authenticated = session.get('authenticated') authenticated = session.get('authenticated')

Loading…
Cancel
Save