fix: new password not required for edit profile

This commit is contained in:
Michael Zetterberg
2024-10-16 10:48:43 +02:00
parent 4fdefcd270
commit 9a0e1fae9d
2 changed files with 3 additions and 3 deletions

View File

@@ -24,7 +24,7 @@ export default function FormContent() {
const email = `${intl.formatMessage({ id: "Email" })} ${intl.formatMessage({ id: "Address" }).toLowerCase()}`
const street = intl.formatMessage({ id: "Address" })
const phoneNumber = intl.formatMessage({ id: "Phone number" })
const password = intl.formatMessage({ id: "Current password" })
const currentPassword = intl.formatMessage({ id: "Current password" })
const retypeNewPassword = intl.formatMessage({ id: "Retype new password" })
const zipCode = intl.formatMessage({ id: "Zip code" })
@@ -72,7 +72,7 @@ export default function FormContent() {
{intl.formatMessage({ id: "Password" })}
</Body>
</header>
<Input label={password} name="password" type="password" />
<Input label={currentPassword} name="password" type="password" />
<NewPassword />
<Input
label={retypeNewPassword}

View File

@@ -26,7 +26,7 @@ export const editProfileSchema = z
),
password: z.string().optional(),
newPassword: passwordValidator(),
newPassword: z.literal("").or(passwordValidator()),
retypeNewPassword: z.string().optional(),
})
.superRefine((data, ctx) => {