File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ export class Config {
5252 Config . protocol = Config . getEnv ( "protocol" , "http" ) ; // used by personal nodered and baseurl()
5353 Config . port = parseInt ( Config . getEnv ( "port" , "3000" ) ) ;
5454 Config . domain = Config . getEnv ( "domain" , "localhost" ) ; // sent to website and used in baseurl()
55-
55+ Config . cookie_secret = Config . getEnv ( "cookie_secret" , "NLgUIsozJaxO38ze0WuHthfj2eb1eIEu" ) ;
5656
5757 Config . amqp_reply_expiration = parseInt ( Config . getEnv ( "amqp_reply_expiration" , "10000" ) ) ; // 10 seconds
5858 Config . amqp_force_queue_prefix = Config . parseBoolean ( Config . getEnv ( "amqp_force_queue_prefix" , "true" ) ) ;
@@ -125,7 +125,7 @@ export class Config {
125125 public static protocol : string = Config . getEnv ( "protocol" , "http" ) ; // used by personal nodered and baseurl()
126126 public static port : number = parseInt ( Config . getEnv ( "port" , "3000" ) ) ;
127127 public static domain : string = Config . getEnv ( "domain" , "localhost" ) ; // sent to website and used in baseurl()
128-
128+ public static cookie_secret : string = Config . getEnv ( "cookie_secret" , "NLgUIsozJaxO38ze0WuHthfj2eb1eIEu" ) ; // Used to protect cookies
129129
130130 public static amqp_reply_expiration : number = parseInt ( Config . getEnv ( "amqp_reply_expiration" , ( 60 * 1000 ) . toString ( ) ) ) ; // 1 min
131131 public static amqp_force_queue_prefix : boolean = Config . parseBoolean ( Config . getEnv ( "amqp_force_queue_prefix" , "true" ) ) ;
Original file line number Diff line number Diff line change @@ -152,8 +152,7 @@ export class LoginProvider {
152152 static async configure ( logger : winston . Logger , app : express . Express , baseurl : string ) : Promise < void > {
153153 LoginProvider . _logger = logger ;
154154 app . use ( cookieSession ( {
155- name : "session" ,
156- keys : [ "key1" , "key2" ]
155+ name : "session" , secret : Config . cookie_secret
157156 } ) ) ;
158157
159158 app . use ( passport . initialize ( ) ) ;
Original file line number Diff line number Diff line change @@ -38,8 +38,7 @@ export class WebServer {
3838 this . app . use ( bodyParser . json ( ) ) ;
3939 this . app . use ( cookieParser ( ) ) ;
4040 this . app . use ( cookieSession ( {
41- name : "session" ,
42- keys : [ "key1" , "key2" ]
41+ name : "session" , secret : Config . cookie_secret
4342 } ) ) ;
4443 this . app . use ( flash ( ) ) ;
4544
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export class Config {
3737 Config . nodered_domain_schema = Config . getEnv ( "nodered_domain_schema" , "" ) ;
3838 Config . noderedusers = Config . getEnv ( "noderedusers" , "" ) ;
3939 Config . noderedadmins = Config . getEnv ( "noderedadmins" , "" ) ;
40+ Config . cookie_secret = Config . getEnv ( "cookie_secret" , "NLgUIsozJaxO38ze0WuHthfj2eb1eIEu" ) ;
4041
4142 Config . flow_refresh_interval = parseInt ( Config . getEnv ( "flow_refresh_interval" , "60000" ) ) ;
4243 Config . flow_refresh_initial_interval = parseInt ( Config . getEnv ( "flow_refresh_initial_interval" , "60000" ) ) ;
@@ -87,6 +88,7 @@ export class Config {
8788 public static nodered_domain_schema : string = Config . getEnv ( "nodered_domain_schema" , "" ) ;
8889 public static noderedusers : string = Config . getEnv ( "noderedusers" , "" ) ;
8990 public static noderedadmins : string = Config . getEnv ( "noderedadmins" , "" ) ;
91+ public static cookie_secret : string = Config . getEnv ( "cookie_secret" , "NLgUIsozJaxO38ze0WuHthfj2eb1eIEu" ) ; // Used to protect cookies
9092
9193 public static flow_refresh_interval : number = parseInt ( Config . getEnv ( "flow_refresh_interval" , "60000" ) ) ;
9294 public static flow_refresh_initial_interval : number = parseInt ( Config . getEnv ( "flow_refresh_initial_interval" , "60000" ) ) ;
Original file line number Diff line number Diff line change @@ -169,8 +169,7 @@ export class WebServer {
169169
170170
171171 this . app . use ( cookieSession ( {
172- name : 'session' ,
173- keys : [ 'key1' , 'key2' ]
172+ name : 'session' , secret : Config . cookie_secret
174173 } ) )
175174
176175 // initialise the runtime with a server and settings
You can’t perform that action at this time.
0 commit comments