fix(auth): align password validation copy (#5759)
* fix(i18n): add missing frontend translations - add missing locale entries for API key loading, channel model empty states, auth, playground, and model configuration copy. - correct inaccurate Russian and Vietnamese model empty-state translations to avoid fallback or misleading copy. * fix(auth): align password validation copy - remove the login password length gate so existing shorter passwords are not blocked before reaching the server. - reuse distinct minimum-length and 8-20 character messages based on the actual validation rule. - drop unused duplicate password locale keys and align the user creation placeholder with the 8-20 character constraint. * fix(i18n): add auth validation message translations - cover schema-driven auth form errors that are translated through FormMessage. - keep password, username, confirmation, and OTP validation messages available in every locale.
This commit is contained in:
+2
-5
@@ -24,10 +24,7 @@ import { z } from 'zod'
|
||||
|
||||
export const loginFormSchema = z.object({
|
||||
username: z.string().min(1, 'Please enter your username or email'),
|
||||
password: z
|
||||
.string()
|
||||
.min(1, 'Please enter your password')
|
||||
.min(8, 'Password must be at least 8 characters long'),
|
||||
password: z.string().min(1, 'Please enter your password'),
|
||||
})
|
||||
|
||||
export const registerFormSchema = z
|
||||
@@ -37,7 +34,7 @@ export const registerFormSchema = z
|
||||
password: z
|
||||
.string()
|
||||
.min(1, 'Please enter your password')
|
||||
.min(8, 'Password must be at least 8 characters long')
|
||||
.min(8, 'Password must be between 8 and 20 characters')
|
||||
.max(20, 'Password must be at most 20 characters long'),
|
||||
confirmPassword: z.string().min(1, 'Please confirm your password'),
|
||||
})
|
||||
|
||||
+2
-2
@@ -221,9 +221,9 @@ export function SetupWizard() {
|
||||
if (!password || password.length < 8) {
|
||||
form.setError('password', {
|
||||
type: 'manual',
|
||||
message: t('Password must be at least 8 characters long'),
|
||||
message: t('Password must be at least 8 characters'),
|
||||
})
|
||||
toast.error(t('Password must be at least 8 characters long'))
|
||||
toast.error(t('Password must be at least 8 characters'))
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -336,7 +336,7 @@ export function UsersMutateDrawer({
|
||||
placeholder={
|
||||
isUpdate
|
||||
? t('Leave empty to keep unchanged')
|
||||
: t('Enter password (min 8 characters)')
|
||||
: t('Enter password (8-20 characters)')
|
||||
}
|
||||
/>
|
||||
</FormControl>
|
||||
|
||||
Reference in New Issue
Block a user