Skip to content

Commit 8610922

Browse files
committed
properly quote and escape query to member service
1 parent 3929e50 commit 8610922

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

connect/service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const getUsersById = (ids) => {
166166
* @return {Promise} resolves to the list of user details
167167
*/
168168
const getUsersByHandle = (handles) => {
169-
const query = _.map(handles, (handle) => 'handle:' + handle).join(' OR ');
169+
const query = _.map(handles, (handle) => 'handle:"' + handle.trim().replace('"', '\\"') + '"').join(' OR ');
170170
return M2m.getMachineToken(config.AUTH0_CLIENT_ID, config.AUTH0_CLIENT_SECRET)
171171
.catch((err) => {
172172
err.message = 'Error generating m2m token: ' + err.message;

src/common/tcApiHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function* getUsersByHandles(handles) {
8383
return [];
8484
}
8585
// use 'OR' to link the handle matches
86-
const query = _.map(handles, (h) => 'handle:"' + h.trim() + '"').join(' OR ');
86+
const query = _.map(handles, (h) => 'handle:"' + h.trim().replace('"', '\\"') + '"').join(' OR ');
8787
return yield searchUsersByQuery(query);
8888
}
8989

0 commit comments

Comments
 (0)