import Cookies from 'js-cookie'

const TokenKey = 'water_dispatch_token'

export function getToken() {
  //return Cookies.get(TokenKey)

  if (Cookies.get(TokenKey)) {
    return Cookies.get(TokenKey)
  } else {
    return sessionStorage.getItem(TokenKey);
  }
}

export function setToken(token) {
  sessionStorage.setItem(TokenKey, token);
  //return Cookies.set(TokenKey, token)
}

export function removeToken() {
  sessionStorage.clear();
  //return Cookies.remove(TokenKey)

}
