UI: тёплый современный дизайн + русификация

This commit is contained in:
2026-05-29 10:38:01 +03:00
parent e4b25fe4b7
commit ea0df060e8
17 changed files with 576 additions and 527 deletions

View File

@@ -9,18 +9,18 @@ router.post('/register', (req: Request, res: Response) => {
const { username, password } = req.body;
if (!username || !password) {
res.status(400).json({ error: 'Username and password required' });
res.status(400).json({ error: 'Заполните все поля' });
return;
}
if (username.length < 3 || password.length < 4) {
res.status(400).json({ error: 'Username min 3 chars, password min 4 chars' });
res.status(400).json({ error: 'Имя от 3 символов, пароль от 4' });
return;
}
const existing = queryOne('SELECT id FROM users WHERE username = ?', [username]);
if (existing) {
res.status(409).json({ error: 'Username already taken' });
res.status(409).json({ error: 'Имя пользователя уже занято' });
return;
}
@@ -38,7 +38,7 @@ router.post('/login', (req: Request, res: Response) => {
const user = queryOne('SELECT id, username, password_hash, points FROM users WHERE username = ?', [username]);
if (!user || !bcrypt.compareSync(password, user.password_hash)) {
res.status(401).json({ error: 'Invalid credentials' });
res.status(401).json({ error: 'Неверное имя пользователя или пароль' });
return;
}