Skip to content

Commit

Permalink
Re-generate session secret at Gladys startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Mar 3, 2018
1 parent 893c2ba commit 8343e8a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* http://sailsjs.org/#/documentation/reference/sails.config/sails.config.session.html
*/

const crypto = require('crypto');
const seed = crypto.randomBytes(20);
const sessionSecret = crypto.createHash('sha1').update(seed).digest('hex');

module.exports.session = {

Expand All @@ -22,7 +25,7 @@ module.exports.session = {
* of your users, forcing them to log in again. *
* *
***************************************************************************/
secret: '7a6b5e8257aaa49ef371a24e669cece4',
secret: sessionSecret,


/***************************************************************************
Expand Down

0 comments on commit 8343e8a

Please sign in to comment.