File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747 "json-stringify-safe" :" 5.0.1" ,
4848 "jsonata" :" 1.3.0" ,
4949 "media-typer" : " 0.3.0" ,
50+ "memorystore" : " 1.6.0" ,
5051 "mqtt" : " 2.9.0" ,
5152 "multer" : " 1.3.0" ,
5253 "mustache" : " 2.3.0" ,
Original file line number Diff line number Diff line change @@ -150,14 +150,19 @@ module.exports = {
150150 login : login ,
151151 revoke : revoke ,
152152 genericStrategy : function ( adminApp , strategy ) {
153- var session = require ( 'express-session' ) ;
154- var crypto = require ( "crypto" ) ;
153+ var crypto = require ( "crypto" )
154+ var session = require ( 'express-session' )
155+ var MemoryStore = require ( 'memorystore' ) ( session )
156+
155157 adminApp . use ( session ( {
156- // As the session is only used across the life-span of an auth
157- // hand-shake, we can use a instance specific random string
158- secret : crypto . randomBytes ( 20 ) . toString ( 'hex' ) ,
159- resave : false ,
160- saveUninitialized :false
158+ // As the session is only used across the life-span of an auth
159+ // hand-shake, we can use a instance specific random string
160+ secret : crypto . randomBytes ( 20 ) . toString ( 'hex' ) ,
161+ resave : false ,
162+ saveUninitialized : false ,
163+ store : new MemoryStore ( {
164+ checkPeriod : 86400000 // prune expired entries every 24h
165+ } )
161166 } ) ) ;
162167 //TODO: all passport references ought to be in ./auth
163168 adminApp . use ( passport . initialize ( ) ) ;
You can’t perform that action at this time.
0 commit comments