Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getPusher = (url) => {
Pusher.logToConsole = true;
Pusher.Runtime.createXHR = () => {
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
return xhr;
};
const pusher = new Pusher(params.PUSHER_KEY, {
cluster: params.PUSHER_CLUSTER,
authEndpoint: url,
auth: {
headers: {
'Content-Type': 'application/json',
'X-XSRF-TOKEN': Cookies.get('XSRF-TOKEN'),
},
},
});