Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix: projects fetching

Piyush Guptaacb0207c83fa
diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx
index d0f38b089a..e9d6031698 100644
--- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx
@@ -197,7 +197,6 @@ export const Navbar = () => {
const handleOrgChange = async (orgId: string) => {
queryClient.removeQueries({ queryKey: authKeys.getAuthToken });
- queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() });
const { token, isMfaEnabled, mfaMethod } = await selectOrganization({
organizationId: orgId
@@ -212,6 +211,11 @@ export const Navbar = () => {
setMfaSuccessCallback(() => () => handleOrgChange(orgId));
return;
}
+
+ SecurityClient.setToken(token);
+ SecurityClient.setProviderAuthToken("");
+ queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() });
+
await router.invalidate();
await navigateUserToOrg(navigate, orgId);
queryClient.removeQueries({ queryKey: subOrgQuery.queryKey });
@@ -219,7 +223,6 @@ export const Navbar = () => {
const handleSubOrgChange = async (subOrgId: string) => {
queryClient.removeQueries({ queryKey: authKeys.getAuthToken });
- queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() });
const { token, isMfaEnabled, mfaMethod } = await selectSubOrganization({
subOrganizationId: subOrgId
@@ -235,6 +238,10 @@ export const Navbar = () => {
return;
}
+ SecurityClient.setToken(token);
+ SecurityClient.setProviderAuthToken("");
+
+ queryClient.removeQueries({ queryKey: projectKeys.getAllUserProjects() });
await router.invalidate();
navigate({
to: "/organizations/$orgId/projects",
@@ -630,7 +637,6 @@ export const Navbar = () => {
<DropdownMenu modal={false}>
<DropdownMenuTrigger>
<div className="rounded-l-md border border-r-0 border-mineshaft-500 px-2.5 py-1 hover:bg-mineshaft-600">
- aple
<FontAwesomeIcon icon={faCircleQuestion} className="text-mineshaft-200" />
</div>
</DropdownMenuTrigger>