Skip to content

Commit

Permalink
chore: only reset form values if supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas committed Nov 26, 2024
1 parent 2e8a2cf commit 6e05aef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/elements-react/src/components/form/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,12 @@ export function OryForm({ children, onAfterSubmit }: OryFormProps) {
break
}
}
methods.setValue("password", "")
if ("password" in data) {
methods.setValue("password", "")
}
if ("code" in data) {
methods.setValue("code", "")
}
onAfterSubmit?.(data.method)
}

Expand Down

0 comments on commit 6e05aef

Please sign in to comment.