mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
feat: support server-side sessions (#25795)
This commit is contained in:
committed by
Michael S. Molina
parent
cc5235829e
commit
bd4c1a7445
@@ -27,6 +27,7 @@ from flask import Flask, redirect
|
||||
from flask_appbuilder import expose, IndexView
|
||||
from flask_babel import gettext as __, lazy_gettext as _
|
||||
from flask_compress import Compress
|
||||
from flask_session import Session
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
|
||||
from superset.constants import CHANGE_ME_SECRET_KEY
|
||||
@@ -474,6 +475,10 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
|
||||
logger.error("Refusing to start due to insecure SECRET_KEY")
|
||||
sys.exit(1)
|
||||
|
||||
def configure_session(self) -> None:
|
||||
if self.config["SESSION_SERVER_SIDE"]:
|
||||
Session(self.superset_app)
|
||||
|
||||
def init_app(self) -> None:
|
||||
"""
|
||||
Main entry point which will delegate to other methods in
|
||||
@@ -481,6 +486,7 @@ class SupersetAppInitializer: # pylint: disable=too-many-public-methods
|
||||
"""
|
||||
self.pre_init()
|
||||
self.check_secret_key()
|
||||
self.configure_session()
|
||||
# Configuration of logging must be done first to apply the formatter properly
|
||||
self.configure_logging()
|
||||
# Configuration of feature_flags must be done first to allow init features
|
||||
|
||||
Reference in New Issue
Block a user