Skip to content

Commit

Permalink
Merge pull request #23 from reactioncommerce/akarshit-feat-add-token-…
Browse files Browse the repository at this point in the history
…secret

"fix: adding token secret"
  • Loading branch information
Akarshit authored Aug 18, 2021
2 parents 9aeaa64 + bb70472 commit 7a18f0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const { str } = envalid;
export default envalid.cleanEnv(
process.env,
{
STORE_URL: str({ devDefault: "http://localhost:4000" })
STORE_URL: str({ devDefault: "http://localhost:4000" }),
TOKEN_SECRET: str({ default: "UPDATE_THIS_SECRET" })
},
{
dotEnvPath: null
Expand Down
3 changes: 2 additions & 1 deletion src/util/accountServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default async (app) => {
if (accountsServer && accountsGraphQL) {
return { accountsServer, accountsGraphQL };
}
const { MONGO_URL, STORE_URL } = config;
const { MONGO_URL, STORE_URL, TOKEN_SECRET } = config;
const { context } = app;

const client = await mongoConnectWithRetry(MONGO_URL);
Expand All @@ -30,6 +30,7 @@ export default async (app) => {
accountsServer = new AccountsServer(
{
siteUrl: STORE_URL,
tokenSecret: TOKEN_SECRET,
db: accountsMongo,
enableAutologin: true,
ambiguousErrorMessages: false,
Expand Down

0 comments on commit 7a18f0c

Please sign in to comment.