This commit is contained in:
2024-01-30 18:47:57 +01:00
parent 5583bc2b60
commit 794b50e041
2 changed files with 21 additions and 0 deletions

View File

@ -20,6 +20,7 @@ app.config.update({
oidc = OpenIDConnect(app)
def calculate_nutrition(food, weight):
try:
conn = psycopg2.connect()
@ -133,6 +134,12 @@ def add_nutrition():
def nutrition():
return render_template('nutrition.html')
@app.route('/get_token')
@oidc.require_login
def get_token():
return jsonify(token=oidc.get_access_token())
app = ProxyFix(app, x_for=1, x_host=1)