修复
This commit is contained in:
@@ -156,17 +156,18 @@ try:
|
||||
_root = _Path(__file__).resolve().parent.parent.parent
|
||||
if str(_root) not in sys.path:
|
||||
sys.path.insert(0, str(_root))
|
||||
from nav_embed import install_nav_embed
|
||||
from nav_embed import install_nav_embed, nav_session_middleware_kwargs
|
||||
|
||||
install_nav_embed(app)
|
||||
_sess_kw = nav_session_middleware_kwargs()
|
||||
except Exception:
|
||||
pass
|
||||
_sess_kw = {"same_site": "lax", "https_only": False}
|
||||
app.add_middleware(
|
||||
SessionMiddleware,
|
||||
secret_key=settings.app.session_secret,
|
||||
max_age=60 * 60 * 24 * 7,
|
||||
same_site="lax",
|
||||
https_only=False,
|
||||
same_site=_sess_kw.get("same_site", "lax"),
|
||||
https_only=bool(_sess_kw.get("https_only", False)),
|
||||
)
|
||||
app.mount("/static", StaticFiles(directory=str(root_dir / "static")), name="static")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user