mirror of
https://github.com/open-webui/open-webui
synced 2024-11-07 00:59:52 +00:00
feat: add WEBUI_SESSION_COOKIE_SECURE
This commit is contained in:
parent
ae376ec8fe
commit
bba4c4242f
@ -760,6 +760,11 @@ WEBUI_SESSION_COOKIE_SAME_SITE = os.environ.get(
|
|||||||
os.environ.get("WEBUI_SESSION_COOKIE_SAME_SITE", "lax"),
|
os.environ.get("WEBUI_SESSION_COOKIE_SAME_SITE", "lax"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
WEBUI_SESSION_COOKIE_SECURE = os.environ.get(
|
||||||
|
"WEBUI_SESSION_COOKIE_SECURE",
|
||||||
|
os.environ.get("WEBUI_SESSION_COOKIE_SECURE", "false").lower() == "true",
|
||||||
|
)
|
||||||
|
|
||||||
if WEBUI_AUTH and WEBUI_SECRET_KEY == "":
|
if WEBUI_AUTH and WEBUI_SECRET_KEY == "":
|
||||||
raise ValueError(ERROR_MESSAGES.ENV_VAR_NOT_FOUND)
|
raise ValueError(ERROR_MESSAGES.ENV_VAR_NOT_FOUND)
|
||||||
|
|
||||||
|
@ -79,6 +79,7 @@ from config import (
|
|||||||
OAUTH_MERGE_ACCOUNTS_BY_EMAIL,
|
OAUTH_MERGE_ACCOUNTS_BY_EMAIL,
|
||||||
WEBUI_SECRET_KEY,
|
WEBUI_SECRET_KEY,
|
||||||
WEBUI_SESSION_COOKIE_SAME_SITE,
|
WEBUI_SESSION_COOKIE_SAME_SITE,
|
||||||
|
WEBUI_SESSION_COOKIE_SECURE,
|
||||||
)
|
)
|
||||||
from constants import ERROR_MESSAGES, WEBHOOK_MESSAGES
|
from constants import ERROR_MESSAGES, WEBHOOK_MESSAGES
|
||||||
from utils.webhook import post_webhook
|
from utils.webhook import post_webhook
|
||||||
@ -964,6 +965,7 @@ if len(OAUTH_PROVIDERS) > 0:
|
|||||||
secret_key=WEBUI_SECRET_KEY,
|
secret_key=WEBUI_SECRET_KEY,
|
||||||
session_cookie="oui-session",
|
session_cookie="oui-session",
|
||||||
same_site=WEBUI_SESSION_COOKIE_SAME_SITE,
|
same_site=WEBUI_SESSION_COOKIE_SAME_SITE,
|
||||||
|
https_only=WEBUI_SESSION_COOKIE_SECURE,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user