mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 22:26:15 +00:00
fix: query invalidation
This commit is contained in:
@@ -196,8 +196,6 @@ export const Navbar = () => {
|
|||||||
const breadcrumbs = matches && "breadcrumbs" in matches ? matches.breadcrumbs : undefined;
|
const breadcrumbs = matches && "breadcrumbs" in matches ? matches.breadcrumbs : undefined;
|
||||||
|
|
||||||
const handleOrgChange = async (orgId: string, onSuccess?: () => void | Promise<void>) => {
|
const handleOrgChange = async (orgId: string, onSuccess?: () => void | Promise<void>) => {
|
||||||
queryClient.removeQueries({ queryKey: authKeys.getAuthToken });
|
|
||||||
|
|
||||||
const { token, isMfaEnabled, mfaMethod } = await selectOrganization({
|
const { token, isMfaEnabled, mfaMethod } = await selectOrganization({
|
||||||
organizationId: orgId
|
organizationId: orgId
|
||||||
});
|
});
|
||||||
@@ -216,6 +214,7 @@ export const Navbar = () => {
|
|||||||
|
|
||||||
SecurityClient.setToken(token);
|
SecurityClient.setToken(token);
|
||||||
SecurityClient.setProviderAuthToken("");
|
SecurityClient.setProviderAuthToken("");
|
||||||
|
queryClient.removeQueries({ queryKey: authKeys.getAuthToken });
|
||||||
queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() });
|
queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() });
|
||||||
|
|
||||||
await router.invalidate();
|
await router.invalidate();
|
||||||
@@ -244,8 +243,6 @@ export const Navbar = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSubOrgChange = async (subOrgId: string) => {
|
const handleSubOrgChange = async (subOrgId: string) => {
|
||||||
queryClient.removeQueries({ queryKey: authKeys.getAuthToken });
|
|
||||||
|
|
||||||
const { token, isMfaEnabled, mfaMethod } = await selectSubOrganization({
|
const { token, isMfaEnabled, mfaMethod } = await selectSubOrganization({
|
||||||
subOrganizationId: subOrgId
|
subOrganizationId: subOrgId
|
||||||
});
|
});
|
||||||
@@ -265,6 +262,7 @@ export const Navbar = () => {
|
|||||||
SecurityClient.setToken(token);
|
SecurityClient.setToken(token);
|
||||||
SecurityClient.setProviderAuthToken("");
|
SecurityClient.setProviderAuthToken("");
|
||||||
|
|
||||||
|
queryClient.removeQueries({ queryKey: authKeys.getAuthToken });
|
||||||
queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() });
|
queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() });
|
||||||
await router.invalidate();
|
await router.invalidate();
|
||||||
navigate({
|
navigate({
|
||||||
|
|||||||
Reference in New Issue
Block a user