This commit is contained in:
Wolfgang Hottgenroth 2024-01-30 13:59:02 +01:00
parent e87675dcbd
commit 8b9654370c
Signed by: wn
GPG Key ID: 836E9E1192A6B132

View File

@ -94,6 +94,7 @@ def calculate_nutrition(food, weight):
# Index-Route # Index-Route
@app.route('/') @app.route('/')
@oidc.require_login @oidc.require_login
@oidc.require_keycloak_role('user')
def index(): def index():
return render_template('index.html') return render_template('index.html')
@ -101,6 +102,7 @@ def index():
@app.route('/get_products') @app.route('/get_products')
@oidc.require_login @oidc.require_login
@oidc.require_keycloak_role('user')
def get_products(): def get_products():
conn = get_db_connection() conn = get_db_connection()
cursor = conn.cursor() cursor = conn.cursor()
@ -117,6 +119,7 @@ def get_products():
# Route zum Hinzufügen und Berechnen von Lebensmitteln # Route zum Hinzufügen und Berechnen von Lebensmitteln
@app.route('/add_lm', methods=['GET']) @app.route('/add_lm', methods=['GET'])
@oidc.require_login @oidc.require_login
@oidc.require_keycloak_role('user')
def add_lm(): def add_lm():
food = request.args.get('food') food = request.args.get('food')
weight = float(request.args.get('weight')) weight = float(request.args.get('weight'))
@ -164,6 +167,7 @@ def add_nutrition():
@app.route('/nutrition') @app.route('/nutrition')
@oidc.require_login @oidc.require_login
@oidc.require_keycloak_role('user')
def nutrition(): def nutrition():
return render_template('nutrition.html') return render_template('nutrition.html')