Skip to content

Commit

Permalink
chore(backend): add settings.SESSION_COOKIE_SECURE
Browse files Browse the repository at this point in the history
  • Loading branch information
wd0517 committed Aug 7, 2024
1 parent 3e4fe3e commit 35999cb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
7 changes: 1 addition & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENVIRONMENT=production
# SECRET_KEY must greater or equal to 32 characters.
SECRET_KEY=

# Replace with your own sentry dsn
# Replace with your own sentry dsn, leave it commented if you don't want to use sentry
# SENTRY_DSN=https://[email protected]/4507549478223872

# Replace with your own TiDB Serverless connection information,
Expand All @@ -17,14 +17,9 @@ TIDB_USER=
TIDB_PASSWORD=
TIDB_DATABASE=


# Replace with your own Jina AI API key
# You can get one from https://jina.ai/reranker/
JINAAI_API_KEY=


# DO NOT CHANGE BELOW CONFIGURATIONS UNLESS YOU KNOW WHAT YOU ARE DOING
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/0

DSP_CACHEBOOL=false
2 changes: 1 addition & 1 deletion backend/app/auth/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def get_user_manager(user_db: SQLModelUserDatabaseAsync = Depends(get_user
cookie_transport = CookieTransport(
cookie_name=settings.SESSION_COOKIE_NAME,
cookie_max_age=settings.SESSION_COOKIE_MAX_AGE,
cookie_secure=settings.ENVIRONMENT != Environment.LOCAL,
cookie_secure=settings.SESSION_COOKIE_SECURE,
)


Expand Down
1 change: 1 addition & 0 deletions backend/app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Settings(BaseSettings):
SESSION_COOKIE_NAME: str = "session"
# 90 days
SESSION_COOKIE_MAX_AGE: int = 3600 * 24 * 90
SESSION_COOKIE_SECURE: bool = False

BROWSER_ID_COOKIE_NAME: str = "bid"
BROWSER_ID_COOKIE_MAX_AGE: int = 3600 * 24 * 365 * 2
Expand Down

0 comments on commit 35999cb

Please sign in to comment.