Skip to content

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

small tweak

x0322053a28a47486d7
diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/RedisAccountForm.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/RedisAccountForm.tsx
index 84e91d3bff..87d6e8ba34 100644
--- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/RedisAccountForm.tsx
+++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountForm/RedisAccountForm.tsx
@@ -143,14 +143,14 @@ export const RedisAccountForm = ({ account, onSubmit }: Props) => {
isChecked={value}
onCheckedChange={(checked) => {
onChange(checked);
- // Clear credential values when toggling
- setValue("credentials.username", undefined, { shouldDirty: true });
- setValue("credentials.password", undefined, { shouldDirty: true });
- // Clear validation errors for credentials when disabled
- if (!checked) {
+ if (checked) {
+ setValue("credentials.username", "", { shouldDirty: true });
+ setValue("credentials.password", "", { shouldDirty: true });
+ } else {
+ setValue("credentials.username", undefined, { shouldDirty: true });
+ setValue("credentials.password", undefined, { shouldDirty: true });
clearErrors("credentials");
}
- // Trigger validation to update form state
form.trigger("credentials");
}}
>