feature/Set secure option conditionally

This commit is contained in:
Marko Milić 2023-12-08 19:05:48 +01:00
parent 01ea8b91e6
commit 0b396eb654

View File

@ -8,6 +8,9 @@ import path from 'path'
const port = 8085
const app: Application = express()
const host = process.env.VITE_OBP_EXPLORER_HOST
const httpsOrNot = host ? host.indexOf("https://") == 0 ? true : false : true
app.use(express.json())
app.use(
session({
@ -16,8 +19,8 @@ app.use(
saveUninitialized: true,
cookie: {
httpOnly: true,
secure: true,
maxAge: 300*1000, // 5 minutes in milliseconds
secure: httpsOrNot,
maxAge: 10*1000, // 5 minutes in milliseconds
}
})
)