Skip to content

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

open account modal after creation

xb3d5ea5abb36
diff --git a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
index e4864d3c68..84e4cf7455 100644
--- a/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/PamAccountsPage.tsx
@@ -324,6 +324,7 @@ export const PamAccountsPage = () => {
onOpenChange={(open) => {
if (!open) handlePopUpClose("createAccount");
}}
+ onCreated={(accountId) => accountSheet.openSheet(accountId)}
/>
<CreateFolderModal
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/CreateAccountSheet.tsx b/frontend/src/pages/pam/PamAccountsPage/components/CreateAccountSheet.tsx
index 58b3c81416..eb88267fcc 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/CreateAccountSheet.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/CreateAccountSheet.tsx
@@ -70,9 +70,10 @@ type Props = {
isOpen: boolean;
onOpenChange: (open: boolean) => void;
defaultFolderId?: string;
+ onCreated?: (accountId: string) => void;
};
-export const CreateAccountSheet = ({ isOpen, onOpenChange, defaultFolderId }: Props) => {
+export const CreateAccountSheet = ({ isOpen, onOpenChange, defaultFolderId, onCreated }: Props) => {
const createAccount = useCreatePamAccount();
const [step, setStep] = useState<1 | 2>(1);
@@ -222,9 +223,10 @@ export const CreateAccountSheet = ({ isOpen, onOpenChange, defaultFolderId }: Pr
...(gateway.gatewayPoolId ? { gatewayPoolId: gateway.gatewayPoolId } : {})
},
{
- onSuccess: () => {
+ onSuccess: (account: { id: string }) => {
createNotification({ text: "Account created", type: "success" });
onOpenChange(false);
+ onCreated?.(account.id);
},
onError: (error) => {
const unmapped = applyServerValidationErrors(error, setError, knownFields);