Skip to content

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

fix(pam): refresh account list after rotating an account

Andrey406d8bfbeddc
diff --git a/frontend/src/hooks/api/pam/mutations.tsx b/frontend/src/hooks/api/pam/mutations.tsx
index 6663fee237..5ae31ab808 100644
--- a/frontend/src/hooks/api/pam/mutations.tsx
+++ b/frontend/src/hooks/api/pam/mutations.tsx
@@ -853,10 +853,8 @@ export const useRotatePamAccount = () => {
const { data } = await apiRequest.post(`/api/v1/pam/accounts/${accountId}/rotation/rotate`);
return data;
},
- onSettled: (_, __, { accountId }) => {
- queryClient.invalidateQueries({ queryKey: pamKeys.accountRotation(accountId) });
- queryClient.invalidateQueries({ queryKey: pamKeys.getAccount(accountId) });
- queryClient.invalidateQueries({ queryKey: pamKeys.accountDependencies(accountId) });
+ onSettled: () => {
+ queryClient.invalidateQueries({ queryKey: pamKeys.account() });
}
});
};