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

+14
View File
@@ -0,0 +1,14 @@
import { PrismaClient } from '@prisma/client';
import { hash } from 'bcryptjs';
// Provision test data directly; production registration remains disabled.
export async function provisionTestUser(input: { username: string; password: string }) {
const db = new PrismaClient();
try {
return await db.user.create({
data: { username: input.username, passwordHash: await hash(input.password, 12) },
});
} finally {
await db.$disconnect();
}
}