Skip to content

Commit

Permalink
fix in config
Browse files Browse the repository at this point in the history
  • Loading branch information
ushliypakostnik committed Sep 19, 2019
1 parent 082c642 commit 9489a35
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ require('dotenv').config();

const env = process.env.NODE_ENV;

const secret = crypto.randomBytes(PASS.RANDOM_BYTES).toString('hex');
const random = Number(process.env.RANDOM_BYTES) || PASS.RANDOM_BYTES;
const secret = crypto.randomBytes(random).toString('hex');

const common = {
PORT: process.env.PORT || 8082,
MEDIA_DIR: process.env.MEDIA_DIR || 'media',
STATIC_SERVE: false,
PASS: {
RANDOM_BYTES: process.env.RANDOM_BYTES || PASS.RANDOM_BYTES,
RANDOM_BYTES:random,
SECRET: secret,
SALT_LENGTH: secret.length,
DB: {
Expand Down

0 comments on commit 9489a35

Please sign in to comment.