Website: follow up changes from pr review (#23471)
Changes: - Updated view-basic-documentation, view-transparency, and view-device-management to log warnings if the Cloudflare headers we use to determine whether or not to show the swag CTA are missing in production - Fixed a typo in save-questionnaire-progress
This commit is contained in:
@@ -57,6 +57,12 @@ module.exports = {
|
||||
|
||||
let showSwagForm = false;
|
||||
// Due to shipping costs, we'll check the requesting user's cf-ipcountry to see if they're in the US, and their cf-iplongitude header to see if they're in the contiguous US.
|
||||
if(sails.config.environment === 'production') {
|
||||
// Log a warning if the cloudflare headers we use are missing in production.
|
||||
if(!this.req.get('cf-ipcountry') || !this.req.get('cf-iplongitude')) {
|
||||
sails.log.warn('When a user visted the docs, the Cloudflare header we use to determine if they are visiting from the contiguous United States is missing.');
|
||||
}
|
||||
}
|
||||
if(this.req.get('cf-ipcountry') === 'US' && this.req.get('cf-iplongitude') > -125) {
|
||||
showSwagForm = true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ module.exports = {
|
||||
sails.log.warn(`When converting a user's (email: ${this.req.me.emailAddress}) getStartedQuestionnaireAnswers to a formatted string to send to the CRM, and error occurred`, err);
|
||||
}
|
||||
// Prepend the user's reported organization to the questionnaireProgressAsAFormattedString
|
||||
questionnaireProgressAsAFormattedString = `organization-acording-to-fleetdm.com: ${this.req.me.organization}\n` + questionnaireProgressAsAFormattedString;
|
||||
questionnaireProgressAsAFormattedString = `organization-according-to-fleetdm.com: ${this.req.me.organization}\n` + questionnaireProgressAsAFormattedString;
|
||||
|
||||
// Create a dictionary of values to send to the CRM for this user.
|
||||
let contactInformation = {
|
||||
|
||||
@@ -41,6 +41,12 @@ module.exports = {
|
||||
|
||||
let showSwagForm = false;
|
||||
// Due to shipping costs, we'll check the requesting user's cf-ipcountry to see if they're in the US, and their cf-iplongitude header to see if they're in the contiguous US.
|
||||
if(sails.config.environment === 'production') {
|
||||
// Log a warning if the cloudflare headers we use are missing in production.
|
||||
if(!this.req.get('cf-ipcountry') || !this.req.get('cf-iplongitude')) {
|
||||
sails.log.warn('When a user visted the device management page, the Cloudflare header we use to determine if they are visiting from the contiguous United States is missing.');
|
||||
}
|
||||
}
|
||||
if(this.req.get('cf-ipcountry') === 'US' && this.req.get('cf-iplongitude') > -125) {
|
||||
showSwagForm = true;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,12 @@ module.exports = {
|
||||
|
||||
let showSwagForm = false;
|
||||
// Due to shipping costs, we'll check the requesting user's cf-ipcountry to see if they're in the US, and their cf-iplongitude header to see if they're in the contiguous US.
|
||||
if(sails.config.environment === 'production') {
|
||||
// Log a warning if the cloudflare headers we use are missing in production.
|
||||
if(!this.req.get('cf-ipcountry') || !this.req.get('cf-iplongitude')) {
|
||||
sails.log.warn('When a user visted the transparency page, the Cloudflare header we use to determine if they are visiting from the contiguous United States is missing.');
|
||||
}
|
||||
}
|
||||
if(this.req.get('cf-ipcountry') === 'US' && this.req.get('cf-iplongitude') > -125) {
|
||||
showSwagForm = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user