import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
const JTOKEN = 'jtoken'
const ATOKEN = 'atoken'
const USER = 'user'
const PASW = 'pasw'

export function getToken() {
  return Cookies.get(TokenKey)
}
export function getJtoken() {
  return Cookies.get(JTOKEN)
}
export function getAtoken() {
  return Cookies.get(ATOKEN)
}
export function getUser() {
  return Cookies.get(USER)
}
export function getPasw() {
  return Cookies.get(PASW)
}

export function setUser(value) {
  return Cookies.set('user', value, { expires: 365 })
}
export function setPasw(value) {
  return Cookies.set('pasw', value, { expires: 365 })
}
export function setJtoken(token) {
  return Cookies.set(JTOKEN, token)
}

export function setAtoken(token) {
  return Cookies.set(ATOKEN, token)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

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

export function removeJoken() {
  return Cookies.remove(JTOKEN)
}
export function removeAoken() {
  return Cookies.remove(ATOKEN)
}

export function removeAllToken() {
	 Cookies.remove('user')
	 Cookies.remove('pasw')
	 Cookies.remove(TokenKey)
	 Cookies.remove(TokenKey)
	 Cookies.remove(ATOKEN)
	 Cookies.remove(JTOKEN)
   return true
}
