Add password letter requirement + labeled strength UI + auto-capitalize name fields

- Reject pure-numeric passwords (must contain ≥1 letter) in RegisterForm, ResetPasswordPage, and backend register/reset-password handlers
- Replace bare strength bars with labeled 2×2 grid: ≥8 символов, Содержит букву, Заглавная буква, Цифра
- Auto-capitalize first letter of each word in "Название отеля" and "Контактное лицо" fields (autoCapitalize="words" + JS handler)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-17 19:35:54 +03:00
parent 1fd12a6dbb
commit e59bc752b0
3 changed files with 37 additions and 8 deletions

View File

@@ -117,6 +117,10 @@ const auth: FastifyPluginAsync = async (fastify) => {
async (request, reply) => {
const { hotelName, address, contact, email, phone, password } = request.body
if (!/[a-zA-Zа-яА-ЯёЁ]/.test(password)) {
return reply.code(400).send({ error: 'Пароль должен содержать хотя бы одну букву' })
}
const { rows: existing } = await db.query(
'SELECT id FROM users WHERE email = $1',
[email.toLowerCase().trim()],
@@ -346,6 +350,11 @@ const auth: FastifyPluginAsync = async (fastify) => {
},
async (request, reply) => {
const { token, password } = request.body
if (!/[a-zA-Zа-яА-ЯёЁ]/.test(password)) {
return reply.code(400).send({ error: 'Пароль должен содержать хотя бы одну букву' })
}
const { rows } = await db.query(
`SELECT id FROM users
WHERE reset_token = $1