Skip to content

Commit

Permalink
FIX: Issue 414 - failing login for domain change (#788)
Browse files Browse the repository at this point in the history
* Changed secure cookie and secure token to false

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update docker-compose.yaml

Signed-off-by: Ritwik G <[email protected]>

* Update backend/sample.env

Signed-off-by: Ritwik G <[email protected]>

* Update backend/backend/settings/base.py

Signed-off-by: Ritwik G <[email protected]>

---------

Signed-off-by: Ritwik G <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
ritwik-g and pre-commit-ci[bot] authored Nov 5, 2024
1 parent ce1f565 commit af93d9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions backend/backend/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ def get_required_setting(
SESSION_EXPIRATION_TIME_IN_SECOND = os.environ.get(
"SESSION_EXPIRATION_TIME_IN_SECOND", 3600
)
SESSION_COOKIE_SECURE = os.environ.get("SESSION_COOKIE_SECURE", True)
CSRF_COOKIE_SECURE = os.environ.get("CSRF_COOKIE_SECURE", True)
SESSION_COOKIE_SECURE = CommonUtils.str_to_bool(
os.environ.get("SESSION_COOKIE_SECURE", "False")
)
CSRF_COOKIE_SECURE = CommonUtils.str_to_bool(
os.environ.get("CSRF_COOKIE_SECURE", "False")
)

PATH_PREFIX = os.environ.get("PATH_PREFIX", "api/v1").strip("/")
# Resetting the path prefix will require reconfiguring all existing deployed APIs
Expand Down
4 changes: 4 additions & 0 deletions backend/sample.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
DJANGO_SETTINGS_MODULE='backend.settings.dev'

# NOTE: Change below to True if you are running in HTTPS mode.
SESSION_COOKIE_SECURE=False
CSRF_COOKIE_SECURE=False

# Default log level
DEFAULT_LOG_LEVEL="INFO"

Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ services:
- ENVIRONMENT=development
labels:
- traefik.enable=true
- traefik.http.routers.frontend.rule=Host(`frontend.unstract.localhost`)
- traefik.http.routers.frontend.rule=Host(`frontend.unstract.localhost`) && !PathPrefix(`/api/v1`, `/deployment`)

platform-service:
image: unstract/platform-service:${VERSION}
Expand Down

0 comments on commit af93d9e

Please sign in to comment.