Skip to content

Scheduling infrastructure for absolutely everyone.

fix: password not updatable after an api error (#8514)

Nafees Nazik668ea088ef13
diff --git a/apps/web/pages/settings/security/password.tsx b/apps/web/pages/settings/security/password.tsx
index e57d853e0d2..28c03260870 100644
--- a/apps/web/pages/settings/security/password.tsx
+++ b/apps/web/pages/settings/security/password.tsx
@@ -199,6 +199,7 @@ const PasswordView = () => {
color="primary"
className="mt-8"
type="submit"
+ onClick={() => formMethods.clearErrors("apiError")}
disabled={isDisabled || passwordMutation.isLoading || sessionMutation.isLoading}>
{t("update")}
</Button>
diff --git a/packages/ui/components/form/inputs/Input.tsx b/packages/ui/components/form/inputs/Input.tsx
index 0e188cb506e..c581617fc2a 100644
--- a/packages/ui/components/form/inputs/Input.tsx
+++ b/packages/ui/components/form/inputs/Input.tsx
@@ -347,10 +347,6 @@ const PlainForm = <T extends FieldValues>(props: FormProps<T>, ref: Ref<HTMLForm
event.preventDefault();
event.stopPropagation();
- if (form.formState?.errors?.apiError) {
- form.clearErrors("root");
- }
-
form
.handleSubmit(handleSubmit)(event)
.catch((err) => {