Добавлено тестовое заполнение и доработки входа

- Добавлено расширенное тестовое заполнение данных через Seed_TestDataPopulation и SeedDataPopulationHelper (включая базовую схему для пользователей 1, 2, 3, их связи и профили).

- Убраны лишние проверки из тестового заполнения: сид теперь только заполняет данные.

- Исправлен WsTestClient: корректная сборка фрагментированных WS-сообщений до полного JSON.

- На странице входа по логину добавлена подсказка про основные тестовые логины 1, 2, 3 (вход без пароля).
This commit is contained in:
AidarKC
2026-04-17 22:26:37 +03:00
parent 30fcde5744
commit ba3ee4290f
6 changed files with 589 additions and 248 deletions
+4 -6
View File
@@ -472,10 +472,10 @@ export class AuthService {
}
async derivePasswordKeyBundle(password) {
if (!password) throw new Error('Введите пароль');
const rootPair = await deriveEd25519FromPassword(password, 'root.key');
const blockchainPair = await deriveEd25519FromPassword(password, 'bch.key');
const devicePair = await deriveEd25519FromPassword(password, 'dev.key');
const normalizedPassword = String(password ?? '');
const rootPair = await deriveEd25519FromPassword(normalizedPassword, 'root.key');
const blockchainPair = await deriveEd25519FromPassword(normalizedPassword, 'bch.key');
const devicePair = await deriveEd25519FromPassword(normalizedPassword, 'dev.key');
return { rootPair, blockchainPair, devicePair };
}
@@ -528,7 +528,6 @@ export class AuthService {
async registerUser(login, password) {
const cleanLogin = (login || '').trim();
if (!cleanLogin) throw new Error('Введите логин');
if (!password) throw new Error('Введите пароль');
const isFree = await this.ensureLoginFree(cleanLogin);
if (!isFree) throw new Error('Этот логин уже занят');
@@ -552,7 +551,6 @@ export class AuthService {
async createSessionForExistingUser(login, password) {
const cleanLogin = (login || '').trim();
if (!cleanLogin) throw new Error('Введите логин');
if (!password) throw new Error('Введите пароль');
const user = await this.getUser(cleanLogin);
if (!user.exists) throw new Error('Пользователь не найден');