Commit 41120b4f authored by tom's avatar tom

do logout from rewards service only if token is preset

parent 3a400a12
......@@ -34,12 +34,14 @@ export default function useLogout() {
if (config.features.rewards.isEnabled) {
const rewardsToken = cookies.get(cookies.NAMES.REWARDS_API_TOKEN);
if (rewardsToken) {
await apiFetch('rewards_logout', { fetchParams: {
method: 'POST',
headers: { Authorization: `Bearer ${ rewardsToken }` },
} });
cookies.remove(cookies.NAMES.REWARDS_API_TOKEN);
}
}
queryClient.resetQueries({
queryKey: getResourceKey('user_info'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment