mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
do logout from rewards service only if token is preset
This commit is contained in:
@@ -34,11 +34,13 @@ export default function useLogout() {
|
||||
|
||||
if (config.features.rewards.isEnabled) {
|
||||
const rewardsToken = cookies.get(cookies.NAMES.REWARDS_API_TOKEN);
|
||||
await apiFetch('rewards_logout', { fetchParams: {
|
||||
method: 'POST',
|
||||
headers: { Authorization: `Bearer ${ rewardsToken }` },
|
||||
} });
|
||||
cookies.remove(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({
|
||||
|
||||
Reference in New Issue
Block a user