File tree 4 files changed +13
-2
lines changed
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
46
46
// The session secret key used for the hashing of signed cookie (used to detect if the client modified the cookie)
47
47
// Signed cookie is another cookie of the same name with the .sig suffix appended
48
48
" 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 ,
49
53
// The session max age is the session cookie expiration time (in milliseconds)
50
54
" maxAge" : 7200000 ,
51
55
// 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 33
33
},
34
34
"api" : {
35
35
"sessionKey" : " r8q,+&1LM3)CD*zAGpx1xm{NeQhc;#" ,
36
+ "trustProxy" : false ,
37
+ "secureCookie" : true ,
36
38
"maxAge" : 7200000 ,
37
39
"salt" : 10 ,
38
40
"enabled" : true ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " openhim-core" ,
3
3
"description" : " The OpenHIM core application that provides logging and routing of http requests" ,
4
- "version" : " 7.2.1 " ,
4
+ "version" : " 7.3.0 " ,
5
5
"main" : " ./lib/server.js" ,
6
6
"bin" : {
7
7
"openhim-core" : " ./bin/openhim-core.js"
Original file line number Diff line number Diff line change @@ -40,12 +40,17 @@ export function setupApp(done) {
40
40
41
41
// Configure Sessions Middleware
42
42
app . keys = [ config . api . sessionKey ]
43
+
44
+ if ( config . api . trustProxy ) {
45
+ app . proxy = true
46
+ }
47
+
43
48
app . use (
44
49
session (
45
50
{
46
51
maxAge : config . api . maxAge || 7200000 ,
47
52
resave : false ,
48
- secure : true ,
53
+ secure : config . api . secureCookie ,
49
54
httpOnly : true ,
50
55
sameSite : 'none' ,
51
56
store : new MongooseStore ( )
You can’t perform that action at this time.
0 commit comments