Allow taking JWT secret from environment in production

This commit is contained in:
D. Berge
2020-09-13 15:02:58 +02:00
parent da7a977c59
commit 225c710142

View File

@@ -50,6 +50,14 @@ try {
config.jwt.secret = buffer.toString("base64");
console.warn("Autogenerated JWT secret (NODE_ENV != production)");
}
} else {
if (!config.jwt) {
config.jwt = {};
}
if (!config.jwt.secret) {
config.jwt.secret = process.env.DOUGAL_JWT_SECRET;
}
}
}