Skip to content

Commit 7500d87

Browse files
[Dashboard] Fix validation for smart account options (#7522)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent fa45dea commit 7500d87

File tree

1 file changed

+20
-1
lines changed
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client

1 file changed

+20
-1
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/ecosystem/[slug]/(active)/configuration/components/client/auth-options-form.client.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ export function AuthOptionsForm({
133133
(data) => {
134134
if (
135135
data.useSmartAccount &&
136+
data.executionMode === "EIP4337" &&
137+
data.accountFactoryType === "custom" &&
136138
data.customAccountFactoryAddress &&
137139
!isAddress(data.customAccountFactoryAddress)
138140
) {
@@ -145,6 +147,23 @@ export function AuthOptionsForm({
145147
path: ["customAccountFactoryAddress"],
146148
},
147149
)
150+
.refine(
151+
(data) => {
152+
if (
153+
data.useSmartAccount &&
154+
data.executionMode === "EIP4337" &&
155+
data.accountFactoryType === "custom" &&
156+
!data.customAccountFactoryAddress
157+
) {
158+
return false;
159+
}
160+
return true;
161+
},
162+
{
163+
message: "Please enter a custom account factory address",
164+
path: ["customAccountFactoryAddress"],
165+
},
166+
)
148167
.refine(
149168
(data) => {
150169
if (data.useSmartAccount && (data.defaultChainId ?? 0) <= 0) {
@@ -212,7 +231,7 @@ export function AuthOptionsForm({
212231
}
213232

214233
let smartAccountOptions: Ecosystem["smartAccountOptions"] | null = null;
215-
if (data.useSmartAccount) {
234+
if (data.useSmartAccount && data.executionMode === "EIP4337") {
216235
let accountFactoryAddress: string;
217236
switch (data.accountFactoryType) {
218237
case "v0.6":

0 commit comments

Comments
 (0)