Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_.each(storage.getAll(), function (value, key) {
if (this._isPersistenceKey(key)) {
storage.remove(key);
}
}, this);
}
async function logout() {
try {
await Axios.post(`${config.backendAPI}/auth/logout`, {
proxy: config.proxy,
});
} catch (errorData) {
throw generateError(errorData);
}
store.remove('token');
Axios.defaults.headers.common.Authorization = '';
}
toggle: function() {
if (store.get('sidebar')) {
store.remove('sidebar');
this.settings.sidebar = false;
} else {
store.set('sidebar', true);
this.settings.sidebar = store.get('sidebar');
}
this.trigger(this.settings);
}
});
$('.js-sidebar-toggle').on('click', function() {
var $el = $(this);
var $sidebar = $('#sidebar');
if ($el.is('.active')) {
$el.removeClass('active');
$sidebar.removeClass('active');
store.remove('sidebar');
} else {
$sidebar.addClass('active');
$el.addClass('active');
store.set('sidebar', true);
}
return false;
});
s.setFavorite = function (id, value) {
if (value) {
s._saveValue("f" + id, 1);
} else {
store.remove("f" + id);
s.dispatchEvent(new DataEvent("change", {
type: "f" + id,
value: value
}));
}
};