diff --git a/README.md b/README.md index 093add60ce9e..55ba5371b35f 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,17 @@ Browse to `http://localhost:8910` to see the web app. Lambda functions run on `yarn hammer generate component MyShinyComponent` will create a component and place it under `web/src/components/MyShinyComponent` +### .ENV + +Auth0 requires a few environmental variables, none of those are private, +so just go ahead and use these: + +``` +AUTH0_DOMAIN=p4p8.eu.auth0.com +AUTH0_CLIENT_ID=b7vN4sVz6yjGrq82ctXJW9NRTvlWzkFU +AUTH0_AUDIENCE=BILLABLE_API +``` + ### Transpiling packages There are a bunch of packages in this repository that will eventually be published diff --git a/api/package.json b/api/package.json index c3d6396104ab..43ba88066539 100644 --- a/api/package.json +++ b/api/package.json @@ -5,6 +5,7 @@ "dependencies": { "@hammerframework/hammer-api": "0.0.0", "apollo-server-lambda": "^2.6.2", + "dotenv": "^8.0.0", "express-jwt": "^5.3.1", "graphql": "^14.3.1", "jwks-rsa": "^1.5.1", diff --git a/api/src/functions/test.js b/api/src/functions/test.js index 10654fed5ca8..f1bb94fb591f 100644 --- a/api/src/functions/test.js +++ b/api/src/functions/test.js @@ -4,10 +4,15 @@ import jwt from "express-jwt"; import jwksRsa from "jwks-rsa"; +import dotenv from "dotenv"; + +// hammer base dir. +dotenv.config("../../.env"); + // Set up Auth0 configuration const authConfig = { - domain: "p4p8.eu.auth0.com", - audience: "BILLABLE_API" + domain: process.env.AUTH0_DOMAIN, + audience: process.env.AUTH0_AUDIENCE }; // Define middleware that validates incoming bearer tokens diff --git a/yarn.lock b/yarn.lock index f356dcda4f2f..be5c82e20e29 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2745,6 +2745,11 @@ dotenv@^6.2.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064" integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w== +dotenv@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.0.0.tgz#ed310c165b4e8a97bb745b0a9d99c31bda566440" + integrity sha512-30xVGqjLjiUOArT4+M5q9sYdvuR4riM6yK9wMcas9Vbp6zZa+ocC9dp6QoftuhTPhFAiLK/0C5Ni2nou/Bk8lg== + duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"