fix: admin/account: bad validation if 'confirm password' is emptied without touching 'password' field

Massimo Melina committed Jun 3, 2022 at 14:23 UTC c73a8ccfb88fd0866d0a84f0f1179f7e92b6c7ce
1 file changed +1 -1
admin/src/AccountsPage.ts
+1 -1
@@ -172,7 +172,7 @@ function AccountForm({ account, done, groups, close }: FormProps) {
172 label: add ? "Password" : "Change password"
173 },
174 !group && { k: 'password2', md: 6, xl: 4, type: 'password', autoComplete: 'new-password', label: 'Repeat password',
175 - getError: (x, { values }) => x !== values.password && "Enter same password" },
175 + getError: (x, { values }) => (x||'') !== (values.password||'') && "Enter same password" },
176 { k: 'ignore_limits', comp: BoolField, xl: 6,
177 helperText: values.ignore_limits ? "Speed limits don't apply to this account" : "Speed limits apply to this account" },
178 { k: 'admin', comp: BoolField, xl: 6, fromField: (v:boolean) => v||null, label: "Permission to access Admin interface",