Adds bracket checking in SHOPIFY_STORE_DOMAIN

This commit is contained in:
Michael Novotny 2023-09-15 10:03:53 -05:00
parent 56597dc2b3
commit acc59e99f9
No known key found for this signature in database

View File

@ -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.');
}
}