File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ const configure = () => {
2020
2121 if ( configData && configData . database ) {
2222 logger . info ( `Using configuration from file: ${ filename } ` ) ;
23- instance = configData ;
23+ instance = configData ;
24+ instance . keys = getKeys ( ) ;
2425 return ;
2526 }
2627 }
@@ -39,7 +40,8 @@ const configure = () => {
3940 user : envMysqlUser ,
4041 password : process . env . DB_MYSQL_PASSWORD ,
4142 name : envMysqlName ,
42- }
43+ } ,
44+ keys : getKeys ( ) ,
4345 } ;
4446 return ;
4547 }
@@ -56,23 +58,24 @@ const configure = () => {
5658 } ,
5759 useNullAsDefault : true
5860 }
59- }
61+ } ,
62+ keys : getKeys ( ) ,
6063 } ;
64+ } ;
6165
66+ const getKeys = ( ) => {
6267 // Get keys from file
6368 if ( ! fs . existsSync ( keysFile ) ) {
6469 generateKeys ( ) ;
6570 } else if ( process . env . DEBUG ) {
6671 logger . info ( 'Keys file exists OK' ) ;
6772 }
6873 try {
69- instance . keys = require ( keysFile ) ;
74+ return require ( keysFile ) ;
7075 } catch ( err ) {
7176 logger . error ( 'Could not read JWT key pair from config file: ' + keysFile , err ) ;
7277 process . exit ( 1 ) ;
7378 }
74-
75- logger . debug ( 'Configuration: ' + JSON . stringify ( instance , null , 2 ) ) ;
7679} ;
7780
7881const generateKeys = ( ) => {
You can’t perform that action at this time.
0 commit comments