From 07d19cdc6669c0ce7d4e29ad8e9d41b050e2159e Mon Sep 17 00:00:00 2001 From: Luuc van der Zee Date: Mon, 5 Aug 2024 13:14:45 +0100 Subject: [PATCH] Add dotenv package --- package-lock.json | 12 ++++++++++++ package.json | 5 +++-- utils/createIdToken.js | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 744236a..8136b3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "cookie-parser": "~1.4.4", "debug": "~2.6.9", + "dotenv": "^16.4.5", "ejs": "~2.6.1", "express": "~4.16.1", "http-errors": "~1.6.3", @@ -213,6 +214,17 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha512-3NdhDuEXnfun/z7x9GOElY49LoqVHoGScmOKwmxhsS8N5Y+Z8KyPPDnaSzqWgYt/ji4mqwfTS34Htrk0zPIXVg==" }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", diff --git a/package.json b/package.json index 7c45d98..2008060 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,12 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "nodemon ./bin/www --env-file=env_files/back-secret.env" + "start": "nodemon ./bin/www" }, "dependencies": { "cookie-parser": "~1.4.4", "debug": "~2.6.9", + "dotenv": "^16.4.5", "ejs": "~2.6.1", "express": "~4.16.1", "http-errors": "~1.6.3", @@ -16,4 +17,4 @@ "nodemon": "^3.1.4", "uuid": "^10.0.0" } -} \ No newline at end of file +} diff --git a/utils/createIdToken.js b/utils/createIdToken.js index 8c61e84..51f7b5c 100644 --- a/utils/createIdToken.js +++ b/utils/createIdToken.js @@ -1,5 +1,6 @@ const jose = require("jose"); const { v4: uuidv4 } = require("uuid"); +require('dotenv').config({ path: './env_files/back-secret.env' }); const secret = new TextEncoder().encode(process.env.FAKE_SSO_JWT_SECRET);