Update password validation rules and dependencies
CI / Backend (build + test) (push) Successful in 1m14s
CI / Frontend (lint + typecheck + build) (push) Successful in 35s

- Updated the version of the ThreeXui.Net package from 1.0.0 to 1.0.1.
- Enhanced password validation in ChangePasswordCommandValidator and RegisterCommandValidator to require at least one uppercase letter and one digit, with a custom error message in Russian.
- Updated the password validation in RegisterForm and ChangePasswordForm to match the new requirements, ensuring consistency across the application.
This commit is contained in:
Leonid Pershin
2026-07-02 22:08:49 +03:00
parent ad94c6ef22
commit 10e50eb8c7
5 changed files with 22 additions and 6 deletions
+9 -2
View File
@@ -15,7 +15,10 @@ const schema = z.object({
.min(3)
.max(32)
.regex(/^[a-zA-Z0-9_.-]+$/),
password: z.string().min(8),
password: z
.string()
.min(8)
.regex(/^(?=.*[A-Z])(?=.*[0-9]).+$/),
})
type FormValues = z.infer<typeof schema>
@@ -36,7 +39,11 @@ export function RegisterForm({ onSuccess }: { onSuccess: () => void }) {
onSuccess()
} catch (error) {
const message =
error instanceof HttpError && error.status === 409 ? t('auth.duplicateUserName') : t('auth.genericError')
error instanceof HttpError && error.status === 409
? t('auth.duplicateUserName')
: error instanceof HttpError
? error.detail
: t('auth.genericError')
toast.error(message)
}
}
@@ -12,7 +12,10 @@ import { changePassword } from '@/features/auth/api'
const schema = z.object({
currentPassword: z.string().min(1),
newPassword: z.string().min(8),
newPassword: z
.string()
.min(8)
.regex(/^(?=.*[A-Z])(?=.*[0-9]).+$/),
})
type FormValues = z.infer<typeof schema>