From 6f6d47d9011bc247df34b08c0bafcd45d11fe3de Mon Sep 17 00:00:00 2001 From: Kostiantyn Horozhanov Date: Thu, 8 Aug 2024 16:55:35 +0200 Subject: [PATCH 1/2] Fix user data hashing --- template.js | 3 ++- template.tpl | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/template.js b/template.js index e7a6b74..377c25d 100644 --- a/template.js +++ b/template.js @@ -201,8 +201,9 @@ function hashData(value) { function hashDataIfNeeded(mappedData) { if (mappedData.user) { + const userDataKeysToHash = ['external_id', 'phone', 'email', 'first_name', 'last_name', 'zip_code']; for (let key in mappedData.user) { - if (key === 'external_id' || key === 'phone' || key === 'email') { + if (userDataKeysToHash.indexOf(key) !== -1) { mappedData.user[key] = hashData(mappedData.user[key]); } } diff --git a/template.tpl b/template.tpl index ca9f84b..68eb8b5 100644 --- a/template.tpl +++ b/template.tpl @@ -816,8 +816,9 @@ function hashData(value) { function hashDataIfNeeded(mappedData) { if (mappedData.user) { + const userDataKeysToHash = ['external_id', 'phone', 'email', 'first_name', 'last_name', 'zip_code']; for (let key in mappedData.user) { - if (key === 'external_id' || key === 'phone' || key === 'email') { + if (userDataKeysToHash.indexOf(key) !== -1) { mappedData.user[key] = hashData(mappedData.user[key]); } } From e09a5b9930de36f5f99fbe744594c7fddf188ec5 Mon Sep 17 00:00:00 2001 From: Kostiantyn Horozhanov Date: Thu, 8 Aug 2024 16:56:07 +0200 Subject: [PATCH 2/2] Meta update --- metadata.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/metadata.yaml b/metadata.yaml index 73ca33d..c5e908c 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,5 +1,7 @@ homepage: "https://stape.io/" versions: + - sha: 6f6d47d9011bc247df34b08c0bafcd45d11fe3de + changeNotes: Fix user data hashing. - sha: 3639d997b1a2d25404a82ddaa428e6af05aba1c0 changeNotes: Added common cookie support. - sha: b0cb2a6c643dd0b5baea1db3d382a1f7bb3bb546