diff --git a/src/login/lib/useUserProfileForm.tsx b/src/login/lib/useUserProfileForm.tsx index 6a06ec5c..486c44be 100644 --- a/src/login/lib/useUserProfileForm.tsx +++ b/src/login/lib/useUserProfileForm.tsx @@ -311,7 +311,7 @@ export function useUserProfileForm(params: ParamsOfUseUserProfileForm): ReturnTy const { min: minStr } = validator; - if (minStr === undefined) { + if (!minStr) { break apply_validator_min_range; } @@ -369,7 +369,7 @@ export function useUserProfileForm(params: ParamsOfUseUserProfileForm): ReturnTy const { kcNumberFormat } = attribute.html5DataAnnotations ?? {}; - if (kcNumberFormat === undefined) { + if (!kcNumberFormat) { break apply_formatters; } @@ -516,7 +516,7 @@ function useGetErrors(params: { kcContext: Pick formFieldState.attribute.name === "username"); - if (usernameFormFieldState === undefined) { + if (!usernameFormFieldState) { break check_password_policy_x; } @@ -889,7 +889,7 @@ function useGetErrors(params: { kcContext: Pick formFieldState.attribute.name === "email"); - if (emailFormFieldState === undefined) { + if (!emailFormFieldState) { break check_password_policy_x; } @@ -1016,7 +1016,7 @@ function useGetErrors(params: { kcContext: Pick parseInt(`${max}`)) { + if (max && value.length > parseInt(`${max}`)) { const msgArgs = ["error-invalid-length-too-long", `${max}`] as const; errors.push({ @@ -1042,7 +1042,7 @@ function useGetErrors(params: { kcContext: Pick parseInt(`${max}`)) { + if (max && intValue > parseInt(`${max}`)) { const msgArgs = ["error-number-out-of-range-too-big", `${max}`] as const; errors.push({ @@ -1173,7 +1173,7 @@ function useGetErrors(params: { kcContext: Pick