mirror of https://github.com/buster-so/buster.git
fix sign out stuff
This commit is contained in:
parent
62c77455c5
commit
2ac7b73311
|
@ -20,7 +20,7 @@ export const useSignOut = () => {
|
|||
console.error('Error clearing browser storage', error);
|
||||
}
|
||||
} finally {
|
||||
navigate({ to: '/auth/login' });
|
||||
navigate({ to: '/auth/login', reloadDocument: true, replace: true });
|
||||
}
|
||||
}, [navigate, openErrorMessage]);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ const getAssetAccess = (
|
|||
passwordRequired: true,
|
||||
isPublic: true,
|
||||
isDeleted: false,
|
||||
isFetched,
|
||||
isFetched: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ const getAssetAccess = (
|
|||
passwordRequired: false,
|
||||
isPublic: false,
|
||||
isDeleted: true,
|
||||
isFetched,
|
||||
isFetched: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ const getAssetAccess = (
|
|||
passwordRequired: false,
|
||||
isPublic: false,
|
||||
isDeleted: false,
|
||||
isFetched,
|
||||
isFetched: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ const getAssetAccess = (
|
|||
passwordRequired: false,
|
||||
isPublic: false,
|
||||
isDeleted: false,
|
||||
isFetched,
|
||||
isFetched: true,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,20 @@
|
|||
import Cookies from 'js-cookie';
|
||||
import { getQueryClient } from '@/integrations/tanstack-query/query-client';
|
||||
|
||||
/**
|
||||
* Clears all browser storage including localStorage, sessionStorage, and cookies
|
||||
* Clears all browser storage including localStorage, sessionStorage, cookies, and React Query cache
|
||||
* @returns void
|
||||
*/
|
||||
export const clearAllBrowserStorage = (): void => {
|
||||
// Clear React Query cache first
|
||||
try {
|
||||
const queryClient = getQueryClient();
|
||||
queryClient.clear(); // Removes all cached queries and mutations
|
||||
queryClient.getQueryCache().clear(); // Additional cleanup of query cache
|
||||
queryClient.getMutationCache().clear(); // Additional cleanup of mutation cache
|
||||
} catch (error) {
|
||||
console.warn('Failed to clear React Query cache:', error);
|
||||
}
|
||||
// Clear localStorage
|
||||
localStorage.clear();
|
||||
|
||||
|
|
|
@ -14,6 +14,6 @@ export const Route = createFileRoute('/auth/logout')({
|
|||
preload: false,
|
||||
loader: async () => {
|
||||
await signOutServerFn();
|
||||
throw redirect({ to: '/auth/login', statusCode: 307 });
|
||||
throw redirect({ to: '/auth/login', statusCode: 307, reloadDocument: true, replace: true });
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue