Skip to content

Commit

Permalink
feat: Set maxAge to None only on debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Jul 14, 2023
1 parent 821ae77 commit 66ca47c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nexus/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ def __init__(self, context: Optional[zmq.asyncio.Context] = None, *args, **kwarg
if self.debug
else os.getenv("DASHBOARD_SECRET_KEY", secrets.token_urlsafe(32))
)
self.add_middleware(SessionMiddleware, secret_key=secretKey, max_age=None)
self.add_middleware(
SessionMiddleware,
session_cookie="user_session",
secret_key=secretKey,
max_age=None if (self.debug) else 14 * 24 * 60 * 60,
)

self.logger = getLogger("uvicorn")

Expand Down

0 comments on commit 66ca47c

Please sign in to comment.