mirror of
https://github.com/OpenBankProject/API-Explorer-II.git
synced 2026-02-06 10:47:04 +00:00
feature/Set secure option conditionally
This commit is contained in:
parent
01ea8b91e6
commit
0b396eb654
@ -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
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user