I’m seeing some unexpected behavior with an OAuth token and it’s requests.
I’ve a Token fetch setup that works as expected. But after having recived said token and go to make API requests with it, none of them return with good data. They all return with an error of 430: invalid token.
Below is a snippet of my user `/me` request. It returns a a 403 with a fresh token
const fetchUserData = async (token: string) => {
fetch(`https://api.figma.com/v1/me`, {
headers: {
'Authorization': `Bearer ${token}`,
}
})
.then(response => response.json())
.then(response => {
if (response.status === 403) console.log(`${response.status}: ${response.err}`)
else {
console.log(`Logged into Figma as ${response.handle}`);
setUserData(response);
}
})
.catch((error) => {
throw new Error (`API Request Failure: ${error}`);
});
};