feat(auth): Add basic authentication to app

This commit is contained in:
Tobias Quadfasel
2024-09-03 16:05:18 +02:00
parent 0b7a8218e7
commit 60206f48ef

View File

@@ -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 = """