From acc59e99f9757ef44c4b87b1621b53a4414db37f Mon Sep 17 00:00:00 2001 From: Michael Novotny Date: Fri, 15 Sep 2023 10:03:53 -0500 Subject: [PATCH] Adds bracket checking in SHOPIFY_STORE_DOMAIN --- lib/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/utils.ts b/lib/utils.ts index 5d456a6ec..7c9310f90 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -23,4 +23,8 @@ export const validateEnvironmentVariables = () => { if (missingEnvironmentVariables.length) { throw new Error(`The following environment variables are missing. Your site will not work without them.\n\n${missingEnvironmentVariables.join('\n')}\n`); } + + if (process.env.SHOPIFY_STORE_DOMAIN?.includes('[') || process.env.SHOPIFY_STORE_DOMAIN?.includes(']')) { + throw new Error('Your `SHOPIFY_STORE_DOMAIN` environment variable includes brackets (ie. `[` and / or `]`). Your site will not work with them there. Please remove them.'); + } }