From 84f7a9deebe9f6b4c0f330ce601418c05f1b2120 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Fri, 11 Dec 2020 17:19:12 +0200 Subject: [PATCH 1/2] Metadata was not passed through sanitizeUser function --- src/util/sanitize.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util/sanitize.js b/src/util/sanitize.js index 3a3d221239..163f07a611 100644 --- a/src/util/sanitize.js +++ b/src/util/sanitize.js @@ -34,12 +34,17 @@ const sanitizeText = str => export const sanitizeUser = entity => { const { attributes, ...restEntity } = entity || {}; const { profile, ...restAttributes } = attributes || {}; - const { bio, displayName, abbreviatedName, publicData } = profile || {}; + const { bio, displayName, abbreviatedName, publicData, metadata } = profile || {}; const sanitizePublicData = publicData => { // TODO: If you add public data, you should probably sanitize it here. return publicData ? { publicData } : {}; }; + const sanitizeMetadata = metadata => { + // TODO: If you add user-generated metadata through Integration API, + // you should probably sanitize it here. + return metadata ? { metadata } : {}; + }; const profileMaybe = profile ? { @@ -48,6 +53,7 @@ export const sanitizeUser = entity => { displayName: sanitizeText(displayName), bio: sanitizeText(bio), ...sanitizePublicData(publicData), + ...sanitizeMetadata(metadata), }, } : {}; From 027237abcce54bf4d6e6e506ba9a7953adc76dd2 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Fri, 11 Dec 2020 17:21:20 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a45db02449..9a2a997b2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ way to update this template, but currently, we follow a pattern: ## Upcoming version 2020-XX-XX +- [fix] Pass metadata through sanitizeUser function. + [#1391](https://github.com/sharetribe/ftw-daily/pull/1391) - [fix] Call for the same page caused unnecessary rendering [#1388](https://github.com/sharetribe/ftw-daily/pull/1388) - [fix] Fix Google Maps default centering if no bounds or center is given.