گرفتن توکن
localStorage.getItem("acc_token")

fetch("/wp-json/acc/v1/runtime/projects/records", {
  headers: {
    Authorization: "Bearer " + localStorage.getItem("acc_token")
  }
})
.then(r=>r.json())
.then(console.log)

Promise {<pending>}

fetch("/wp-json/acc/v1/runtime/projects/records", {
  headers: {
    Authorization: "Bearer " + localStorage.getItem("acc_token")
  }
})
.then(async r => {
  console.log("STATUS:", r.status);
  const data = await r.json();
  console.log("DATA:", data);
})
.catch(console.error);
