AuthProvider triggeres many times getIdentity()
Hello, i'm using Strapi as my backend and I get a lots of API calls that uses method getIdentity() from authProvider.
How to fix it?
How to fix it?
getIdentity: async () => {
const token = localStorage.getItem(TOKEN_KEY);
if (!token) {
return null;
}
const { data, status } = await strapiAuthHelper.me(token, {
meta: {
populate: "*",
},
});
if (status === 200) {
// console.log(data);
const { id, username, email, name, avatar, role } = data;
return {
id,
username: username,
name: name,
email,
avatar,
role,
};
}
return null;
},