This commit is contained in:
iFargle
2023-02-19 15:25:08 +09:00
parent 69a4d51fc5
commit bd9eedc630
2 changed files with 10 additions and 9 deletions

View File

@@ -8,12 +8,10 @@ from concurrent.futures import wait, ALL_COMPLETED
from flask_executor import Executor
from flask.logging import create_logger
AUTH_TYPE = os.environ["AUTH_TYPE"].replace('"', '')
STATIC_URL_PATH = "/static"
app = FlaskOIDC(__name__)
app.config.from_object(CustomConfig)
if AUTH_TYPE.lower() == "oidc": from flaskoidc import FlaskOIDC
app = init_app()
app = Flask(__name__)
LOG = create_logger(app)
executor = Executor(app)

View File

@@ -14,15 +14,18 @@ STATIC_URL_PATH = "/static"
# Set Authentication type:
if AUTH_TYPE.lower() == "oidc":
# Load OIDC libraries
from flaskoidc import FlaskOIDC
from flaskoidc.config import BaseConfig
# Custom configuration class, a subclass of BaseConfig
CustomConfig(BaseConfig):
DEBUG = True
app = FlaskOIDC(__name__, static_url_path=STATIC_URL_PATH)
LOG = create_logger(app)
app.config.from_object(CustomConfig)
LOG.error("Loading OIDC libraries and configuring app...")
# TODO:
# If OIDC is enabled, add user info and a logout button to the top bar.
elif AUTH_TYPE.lower() == "basic":
app = Flask(__name__, static_url_path=STATIC_URL_PATH)