From 60206f48ef142f1f69af02b1855ba0f339b0743b Mon Sep 17 00:00:00 2001 From: Tobias Quadfasel Date: Tue, 3 Sep 2024 16:05:18 +0200 Subject: [PATCH] feat(auth): Add basic authentication to app --- app/app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/app.py b/app/app.py index 9b97855..8cf7baa 100644 --- a/app/app.py +++ b/app/app.py @@ -1,6 +1,8 @@ import json +import os from typing import Any, Dict, Tuple +import dash_auth import pandas as pd from app_styles import header_style from dash import ( @@ -22,6 +24,10 @@ from sql_utils import execute_query, test_db_connection external_stylesheets = ["https://codepen.io/chriddyp/pen/bWLwgP.css"] app = Dash(__name__, external_stylesheets=external_stylesheets) +auth = dash_auth.BasicAuth( + app, + {os.getenv("APP_UNAME"): os.getenv("APP_PW")}, +) app.index_string = header_style notification_md = """