From ceb23160d173b643c39e110a6d716d919b407a53 Mon Sep 17 00:00:00 2001 From: Stephen Rugh Date: Mon, 16 Sep 2024 16:12:32 -0500 Subject: [PATCH] adds check for staging to host Signed-off-by: Stephen Rugh --- scripts/configs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/configs.js b/scripts/configs.js index 97785908f5..aa5e5f21d4 100644 --- a/scripts/configs.js +++ b/scripts/configs.js @@ -8,9 +8,9 @@ const ALLOWED_CONFIGS = ['prod', 'stage', 'dev']; * @returns {string} - environment identifier (dev, stage or prod'. */ export const calcEnvironment = () => { - const { href } = window.location; + const { host, href } = window.location; let environment = 'prod'; - if (href.includes('.aem.page')) { + if (href.includes('.aem.page') || host.includes('staging')) { environment = 'stage'; } if (href.includes('localhost')) {