function jwtDecode(token){
  try {
    let base64Url = token.split('.')[1];
    let base64 = atob(base64Url);
    return JSON.parse(base64); 
  } catch (err) {
    console.log(err);
  }
}

export default jwtDecode;