Skip to content

Commit f177c74

Browse files
committed
Fix ENABLE_TRACKING_DATA_FOR_ANALYTICS ignor for updateEvent
1 parent 398aed1 commit f177c74

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

cognito.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const { v4 } = require('uuid');
55
const ApplicationStorage = require('./storage')
66

77
var poolData = {
8-
UserPoolId: 'us-east-1_UAf0SxZ5c',
9-
ClientId: '72nrnku0iajiqlahhvkvhqgln2',
8+
UserPoolId: process.env.COGNITO_USERPOOL_ID || 'us-east-1_UAf0SxZ5c',
9+
ClientId: process.env.COGNITO_CLIENT_ID || '72nrnku0iajiqlahhvkvhqgln2',
1010
Storage: ApplicationStorage
1111
};
1212
var userPool = process.env.ENABLE_TRACKING_DATA_FOR_ANALYTICS ? new AmazonCognitoIdentity.CognitoUserPool(poolData) : null;

pinpoint.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ var AWS = require('aws-sdk');
22
const { exec } = require('child_process');
33
const { v4 } = require('uuid');
44
const ApplicationStorage = require('./storage')
5-
const COGNITO_PINPOINT_APPID = '4c6b346287ab4e86a284a88e46352738'
6-
const COGNITO_IDENTITY_POOL_ID = 'us-east-1:9e72cdc0-12d9-471c-ba71-a6a20e6e15ab'
7-
const COGNITO_PINPOINT_REGION = 'us-east-1'
5+
const COGNITO_PINPOINT_APPID = process.env.COGNITO_PINPOINT_APPID || '4c6b346287ab4e86a284a88e46352738'
6+
const COGNITO_IDENTITY_POOL_ID = process.env.COGNITO_IDENTITY_POOL_ID || 'us-east-1:9e72cdc0-12d9-471c-ba71-a6a20e6e15ab'
7+
const COGNITO_PINPOINT_REGION = process.env.COGNITO_PINPOINT_REGION || 'us-east-1'
88

99
function getCognitoCredentials() {
1010
const cognitoIdentity = new AWS.CognitoIdentity({ region: COGNITO_PINPOINT_REGION });

storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path')
22
const fs = require('fs')
3-
const FILE_STORAGE = '.storage'
3+
const FILE_STORAGE = process.env.LOCAL_CONFIGURATION_STORAGE || '.storage'
44
if (!fs.existsSync(path.resolve(__dirname, FILE_STORAGE))) {
55
fs.mkdirSync(path.resolve(__dirname, FILE_STORAGE))
66
}

0 commit comments

Comments
 (0)