Added SESSION_COOKIE_SAMESITE and SESSION_COOKIE_SECURE to create_app of the test site, to set the SameSite and Secure flags for the session cookie.
This commit is contained in:
parent
a691cfd2da
commit
961385c389
@ -52,6 +52,8 @@ def create_app(is_testing: bool = False) -> Flask:
|
|||||||
db_uri: str = "sqlite:///" if is_testing else "sqlite:///local.sqlite"
|
db_uri: str = "sqlite:///" if is_testing else "sqlite:///local.sqlite"
|
||||||
app.config.from_mapping({
|
app.config.from_mapping({
|
||||||
"SECRET_KEY": os.environ.get("SECRET_KEY", token_urlsafe(32)),
|
"SECRET_KEY": os.environ.get("SECRET_KEY", token_urlsafe(32)),
|
||||||
|
"SESSION_COOKIE_SAMESITE": "Lax",
|
||||||
|
"SESSION_COOKIE_SECURE": True,
|
||||||
"SQLALCHEMY_DATABASE_URI": db_uri,
|
"SQLALCHEMY_DATABASE_URI": db_uri,
|
||||||
"BABEL_DEFAULT_LOCALE": "en",
|
"BABEL_DEFAULT_LOCALE": "en",
|
||||||
"ALL_LINGUAS": "zh_Hant|正體中文,en|English,zh_Hans|简体中文",
|
"ALL_LINGUAS": "zh_Hant|正體中文,en|English,zh_Hans|简体中文",
|
||||||
|
Loading…
Reference in New Issue
Block a user