Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$(document).ajaxSend((event, jqxhr, settings) => {
if (settings.type !== 'GET') {
return jqxhr.setRequestHeader('X-CSRF-Token', cookies.get('CSRF-Token'));
}
});
loadSession (onFail = (function () {}), onOpen = (function () {})) {
let lastURL = Cookies.get('ARGOTabs_lastURL')
const locationURL = window.location.href.match(/^[^#]*#\/url\/([^#]*)#?(.*)$/)
if (locationURL) {
lastURL = decodeURIComponent(locationURL[1])
window.history.replaceState(null, '', '/#' + locationURL[2])
}
try {
if (!lastURL) {
throw new Error('No session to resume')
}
const source = Backend.load(lastURL)
if (!source.exists()) {
throw new Error('Entry for ' + lastURL + 'does not exist')
has: function has(key) {
return Cookies.get(key) === undefined ? false : true;
}
},
get: function get(key) {
return this.has(key) ? Cookies.get(key) : null;
},