import Cookies from 'js-cookie';

const TokenKey = 'Admin-Token';
const Tenantid = 'Tenantid';

export function getToken() {
  return Cookies.get(TokenKey);
}
export function getTenantid() {
  return Cookies.get(Tenantid);
}

export function setToken(token) {
  return Cookies.set(TokenKey, token);
}
export function setTenantid(id) {
  return Cookies.set(Tenantid, id);
}

export function removeToken() {
  return Cookies.remove(TokenKey);
}

export function removeTenantid() {
  return Cookies.remove(Tenantid);
}

export function setBiAuth(token) {
  if (!token) return false;
  sessionStorage.setItem("DSK_SYSTEM_AUTH_TOKEN", token);
  return true;
}
