File tree Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ The following config option are provided by the OpenHIM. All of these options ha
4646 // The session secret key used for the hashing of signed cookie (used to detect if the client modified the cookie)
4747 // Signed cookie is another cookie of the same name with the .sig suffix appended
4848 " sessionKey" : " r8q,+&1LM3)CD*zAGpx1xm{NeQhc;#" ,
49+ // If OpenHIM is behind a proxy (should be `true` if the proxy sends relevant Forwarded headers)
50+ " trustProxy" : false ,
51+ // Secure the cookie (either protocol is https or trusting a secured proxy)
52+ secureCookie: true ,
4953 // The session max age is the session cookie expiration time (in milliseconds)
5054 " maxAge" : 7200000 ,
5155 // The number of characters that will be used to generate a random salt for the encryption of passwords
Original file line number Diff line number Diff line change 3333 },
3434 "api" : {
3535 "sessionKey" : " r8q,+&1LM3)CD*zAGpx1xm{NeQhc;#" ,
36+ "trustProxy" : false ,
37+ "secureCookie" : true ,
3638 "maxAge" : 7200000 ,
3739 "salt" : 10 ,
3840 "enabled" : true ,
Original file line number Diff line number Diff line change 11{
22 "name" : " openhim-core" ,
33 "description" : " The OpenHIM core application that provides logging and routing of http requests" ,
4- "version" : " 7.2.1 " ,
4+ "version" : " 7.3.0 " ,
55 "main" : " ./lib/server.js" ,
66 "bin" : {
77 "openhim-core" : " ./bin/openhim-core.js"
Original file line number Diff line number Diff line change @@ -40,12 +40,17 @@ export function setupApp(done) {
4040
4141 // Configure Sessions Middleware
4242 app . keys = [ config . api . sessionKey ]
43+
44+ if ( config . api . trustProxy ) {
45+ app . proxy = true
46+ }
47+
4348 app . use (
4449 session (
4550 {
4651 maxAge : config . api . maxAge || 7200000 ,
4752 resave : false ,
48- secure : true ,
53+ secure : config . api . secureCookie ,
4954 httpOnly : true ,
5055 sameSite : 'none' ,
5156 store : new MongooseStore ( )
You can’t perform that action at this time.
0 commit comments