diff --git a/app/livechat/server/api/v1/pageVisited.js b/app/livechat/server/api/v1/pageVisited.js index 4b35cd3adb6e..e5ef7c42ba64 100644 --- a/app/livechat/server/api/v1/pageVisited.js +++ b/app/livechat/server/api/v1/pageVisited.js @@ -1,9 +1,7 @@ -import { Meteor } from 'meteor/meteor'; import { Match, check } from 'meteor/check'; import _ from 'underscore'; import { API } from '../../../../api'; -import { findGuest, findRoom } from '../lib/livechat'; import { Livechat } from '../../lib/Livechat'; API.v1.addRoute('livechat/page.visited', { @@ -11,7 +9,7 @@ API.v1.addRoute('livechat/page.visited', { try { check(this.bodyParams, { token: String, - rid: String, + rid: Match.Maybe(String), pageInfo: Match.ObjectIncluding({ change: String, title: String, @@ -22,17 +20,6 @@ API.v1.addRoute('livechat/page.visited', { }); const { token, rid, pageInfo } = this.bodyParams; - - const guest = findGuest(token); - if (!guest) { - throw new Meteor.Error('invalid-token'); - } - - const room = findRoom(token, rid); - if (!room) { - throw new Meteor.Error('invalid-room'); - } - const obj = Livechat.savePageHistory(token, rid, pageInfo); if (obj) { const page = _.pick(obj, 'msg', 'navigation');