Skip to content

Commit

Permalink
fix: only allow endpoint in test mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tapiarafael authored and ggazzo committed Sep 12, 2024
1 parent 3279158 commit cb5e7d0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/meteor/app/livechat/server/api/v1/contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ API.v1.addRoute(
{ authRequired: true, permissionsRequired: ['view-livechat-contact'], validateParams: isGETOmnichannelContactsProps },
{
async get() {
if (process.env.TEST_MODE?.toUpperCase() !== 'TRUE') {
throw new Meteor.Error('error-not-allowed', 'This endpoint is only allowed in test mode');
}
const contact = await getContactById(this.queryParams.contactId);

return API.v1.success({ contact });
Expand Down

0 comments on commit cb5e7d0

Please sign in to comment.