import Cookies from 'js-cookie'

const TokenKey = 'TOKEN'
const CodeToken = 'CODE_TOKEN'
const TokenPre = 'Bearer '
export function getToken() {
  return Cookies.get(TokenKey)
}

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

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

export function getFullToken() {
  var token = Cookies.get(TokenKey)
  if (token) {
    token = TokenPre + token
  }
  return token
}

export function getCodeToken() {
  return Cookies.get(CodeToken)
}

export function setCodeToken(token) {
  return Cookies.set(CodeToken, token)
}
