#Hey there so im currently loading my
1 messages · Page 1 of 1 (latest)
const userCreditCheck = async (e) => {
e.preventDefault();
const data = { name };
const res = await fetch(`https://api.noroff.dev/api/v1/auction/profiles/${name}/credits`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
body: undefined,
});
const json = await res.json();
console.log(json);
};
So like on this, if u would logout and clear the token after logged in, u would still be abl eto see the credits etc would you?
Yes correct, because fetched data is not going anywhere
But after logging out react wont show the data in the UI
To find the fetched data you need to inspect the network tab etc