mirror of
https://github.com/OpenBankProject/API-Explorer-II.git
synced 2026-02-06 10:47:04 +00:00
Merge pull request #149 from OpenBankProject/fix_session_pw_var
add def value to session pw
This commit is contained in:
commit
bf87c919c1
@ -118,10 +118,20 @@ console.info(
|
||||
`Session maxAge configured: ${sessionMaxAgeSeconds} seconds (${sessionMaxAgeSeconds / 60} minutes)`
|
||||
)
|
||||
app.use(express.json())
|
||||
// Session secret - MUST be set in production
|
||||
const sessionSecret =
|
||||
process.env.VITE_OBP_SERVER_SESSION_PASSWORD || 'dev-secret-change-in-production'
|
||||
if (!process.env.VITE_OBP_SERVER_SESSION_PASSWORD) {
|
||||
console.warn(
|
||||
'WARNING: VITE_OBP_SERVER_SESSION_PASSWORD is not set. Using default secret for development only.'
|
||||
)
|
||||
console.warn('WARNING: Set VITE_OBP_SERVER_SESSION_PASSWORD in your .env file for production!')
|
||||
}
|
||||
|
||||
let sessionObject = {
|
||||
store: redisStore,
|
||||
name: 'obp-api-explorer-ii.sid', // CRITICAL: Unique cookie name to prevent conflicts with other apps on localhost
|
||||
secret: process.env.VITE_OBP_SERVER_SESSION_PASSWORD,
|
||||
secret: sessionSecret,
|
||||
resave: false,
|
||||
saveUninitialized: false, // Don't save empty sessions (better for authenticated apps)
|
||||
cookie: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user