Skip to content
Snippets Groups Projects
Unverified Commit c83a78f5 authored by Kevin Aleman's avatar Kevin Aleman Committed by GitHub
Browse files

[FIX] GDPR action to forget visitor data on request (#24441)

parent 61fa8f14
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import { findGuest, normalizeHttpHeaderData } from '../lib/livechat';
import { Livechat } from '../../lib/Livechat';
import { ILivechatVisitorDTO } from '../../../../../definition/ILivechatVisitor';
import { IRoom } from '../../../../../definition/IRoom';
import { settings } from '../../../../settings/server';
API.v1.addRoute('livechat/visitor', {
async post() {
......@@ -104,7 +105,8 @@ API.v1.addRoute('livechat/visitor/:token', {
},
}).fetch();
if (rooms?.length) {
// if gdpr is enabled, bypass rooms check
if (rooms?.length && !settings.get('Livechat_Allow_collect_and_store_HTTP_header_informations')) {
throw new Meteor.Error('visitor-has-open-rooms', 'Cannot remove visitors with opened rooms');
}
......
......@@ -567,7 +567,7 @@ Meteor.startup(function () {
alert: 'Force_visitor_to_accept_data_processing_consent_enabled_alert',
i18nLabel: 'Force_visitor_to_accept_data_processing_consent',
i18nDescription: 'Force_visitor_to_accept_data_processing_consent_description',
enableQuery: omnichannelEnabledQuery,
enableQuery: [omnichannelEnabledQuery, { _id: 'Livechat_Allow_collect_and_store_HTTP_header_informations', value: true }],
});
this.add('Livechat_data_processing_consent_text', '', {
......@@ -578,7 +578,11 @@ Meteor.startup(function () {
public: true,
i18nLabel: 'Data_processing_consent_text',
i18nDescription: 'Data_processing_consent_text_description',
enableQuery: [{ _id: 'Livechat_force_accept_data_processing_consent', value: true }, omnichannelEnabledQuery],
enableQuery: [
{ _id: 'Livechat_force_accept_data_processing_consent', value: true },
{ _id: 'Livechat_Allow_collect_and_store_HTTP_header_informations', value: true },
omnichannelEnabledQuery,
],
});
this.add('Livechat_agent_leave_action', 'none', {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment