From fe1223c8301a8d0bfab3a5e30990fe3f5b257830 Mon Sep 17 00:00:00 2001 From: Awais Jibran Date: Fri, 6 Aug 2021 10:51:28 +0500 Subject: [PATCH] refactor: update .env file with falsy values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More detail - if a variable isn’t defined in internal, these values will get used as fallbacks. They’re also bad fallbacks, unfortunately. When we originally set this system up, we didn’t realize that null would actually be cast to "null" when it gets into the MFE… meaning the string “null”, which is _truthy_, and very much not the same as null. It’s a good practice to replace these `null`’s with `''` (an empty string) which will actually evaluate to be falsy. Note that they only ever get used as fallbacks if we’ve screwed something up, so the existence of this file is kind of misleading - we always want the values from internal to be used. --- .env | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.env b/.env index d78446d67..909023cdb 100644 --- a/.env +++ b/.env @@ -1,24 +1,24 @@ NODE_ENV='production' -ACCESS_TOKEN_COOKIE_NAME=null -BASE_URL=null -CREDENTIALS_BASE_URL=null -CSRF_TOKEN_API_PATH=null -DISCOVERY_API_BASE_URL= -ECOMMERCE_BASE_URL=null +ACCESS_TOKEN_COOKIE_NAME='' +BASE_URL='' +CREDENTIALS_BASE_URL='' +CSRF_TOKEN_API_PATH='' +DISCOVERY_API_BASE_URL='' +ECOMMERCE_BASE_URL='' FAVICON_URL='' -LANGUAGE_PREFERENCE_COOKIE_NAME=null -LMS_BASE_URL=null -LOGIN_URL=null +LANGUAGE_PREFERENCE_COOKIE_NAME='' +LMS_BASE_URL='' +LOGIN_URL='' LOGO_TRADEMARK_URL='' LOGO_URL='' LOGO_WHITE_URL='' LOGOUT_URL=null -MARKETING_SITE_BASE_URL=null -ORDER_HISTORY_URL=null -PUBLISHER_BASE_URL= -REFRESH_ACCESS_TOKEN_ENDPOINT=null -SEGMENT_KEY=null -SITE_NAME=null -SUPPORT_EMAIL=null -SUPPORT_URL=null -USER_INFO_COOKIE_NAME=null +MARKETING_SITE_BASE_URL='' +ORDER_HISTORY_URL='' +PUBLISHER_BASE_URL='' +REFRESH_ACCESS_TOKEN_ENDPOINT='' +SEGMENT_KEY='' +SITE_NAME='' +SUPPORT_EMAIL='' +SUPPORT_URL='' +USER_INFO_COOKIE_NAME=''