File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,10 +118,20 @@ console.info(
118118 `Session maxAge configured: ${ sessionMaxAgeSeconds } seconds (${ sessionMaxAgeSeconds / 60 } minutes)`
119119)
120120app . use ( express . json ( ) )
121+ // Session secret - MUST be set in production
122+ const sessionSecret =
123+ process . env . VITE_OBP_SERVER_SESSION_PASSWORD || 'dev-secret-change-in-production'
124+ if ( ! process . env . VITE_OBP_SERVER_SESSION_PASSWORD ) {
125+ console . warn (
126+ 'WARNING: VITE_OBP_SERVER_SESSION_PASSWORD is not set. Using default secret for development only.'
127+ )
128+ console . warn ( 'WARNING: Set VITE_OBP_SERVER_SESSION_PASSWORD in your .env file for production!' )
129+ }
130+
121131let sessionObject = {
122132 store : redisStore ,
123133 name : 'obp-api-explorer-ii.sid' , // CRITICAL: Unique cookie name to prevent conflicts with other apps on localhost
124- secret : process . env . VITE_OBP_SERVER_SESSION_PASSWORD ,
134+ secret : sessionSecret ,
125135 resave : false ,
126136 saveUninitialized : false , // Don't save empty sessions (better for authenticated apps)
127137 cookie : {
You can’t perform that action at this time.
0 commit comments