feat: add admin user management and disable public registration

This commit is contained in:
陈煜 committed 2026-10-05 14:08:39 +08:00
1 parent cfbba73791
commit 312a5ccb86
32 files changed
+1120 -69

No files matched your search

+3 -1
View File
@@ -1,3 +1,4 @@
import { provisionTestUser } from './user-fixture';
import { fixtureFetch } from './backup-fixture';
import 'dotenv/config';
import { test } from 'node:test';
@@ -31,7 +32,8 @@ test('privacy, minute history, backup-gated clear and idle sessions remain user
const username = 'wp_privacy_' + randomUUID(),
password = randomBytes(18).toString('hex');
names.push(username);
const r = await call('/auth/register', 'POST', { username, password });
await provisionTestUser({ username, password });
const r = await call('/auth/login', 'POST', { username, password });
assert.equal(r.status, 201);
const u = await db.user.findUniqueOrThrow({ where: { username } });
return { ...r, username, password, id: u.id };