import jwt_decode from "jwt-decode";

export function getToken() {
  const storedToken = localStorage.getItem('auth_token')

  if (storedToken !== null && jwt_decode(storedToken).exp * 1000 > Date.now()) {
    return storedToken
  }
}

export function setToken(token) {
  localStorage.setItem('auth_token', token)
}
