import Cookies from 'js-cookie'

const TokenKey = 'fsmanager-Token'

export function getToken() {
  if (Cookies.get(TokenKey) != null) {
    return Cookies.get(TokenKey)
  } else {
    return localStorage.getItem(TokenKey)
  }
}

export function setToken(token) {
  localStorage.setItem(TokenKey, token)
  console.log('storage vooki')
  return Cookies.set(TokenKey, token)
}

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