diff --git a/login/index.js b/login/index.js index 9bc43f8..0a81a92 100644 --- a/login/index.js +++ b/login/index.js @@ -3,6 +3,7 @@ // https://paul-senon.medium.com/node-express-js-cookies-set-get-secure-884311606148 import express from "express"; +const dotenv = require('dotenv'); const formParser = require("body-parser").urlencoded({ extended: false }); import { PortierClient } from "portier"; @@ -27,6 +28,8 @@ const cookieParser = require('cookie-parser'); // POST /logout Clear session cookies // GET /logout Display a button to POST /logout +dotenv.config({ path: './.env' }); + const portier = new PortierClient({ //broker: process.env.PORTIER_URL, redirectUri: process.env.BASE_URL + "/login/verify", diff --git a/package.json b/package.json index aa2f0ba..844d092 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "cookie-parser": "^1.4.6", "cookie-universal-nuxt": "^2.1.5", "core-js": "^3.15.1", + "dotenv": "^10.0.0", "express": "^4.17.1", "leaflet": "^1.7.1", "net": "^1.0.2", diff --git a/yarn.lock b/yarn.lock index 433d3de..fb062e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4052,6 +4052,11 @@ dot-prop@^5.2.0: dependencies: is-obj "^2.0.0" +dotenv@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" + integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== + dotenv@^8.1.0: version "8.6.0" resolved "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz"