Skip to content

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

fix(auth): invalidate auth token query on organization selection success

Victor Hugo dos Santos5b9ab4d146db
diff --git a/frontend/src/hooks/api/auth/queries.tsx b/frontend/src/hooks/api/auth/queries.tsx
index 9f88e71e4b..6f0ce35a07 100644
--- a/frontend/src/hooks/api/auth/queries.tsx
+++ b/frontend/src/hooks/api/auth/queries.tsx
@@ -103,6 +103,7 @@ export const useSelectOrganization = () => {
return data;
},
onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: authKeys.getAuthToken });
queryClient.invalidateQueries({
queryKey: [organizationKeys.getUserOrganizations, projectKeys.getAllUserProjects]
});