feat(auth): refine demo mode support using SHUMAI_DEMO_MODE API

This commit is contained in:
yiling
2026-06-19 00:36:23 +08:00
parent 5c285b172b
commit 53c132e41d
9 changed files with 16 additions and 17 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ export const auth = betterAuth({
const info = await teamService.getSignupInfo()
if (info.userCount > 0) {
if (info.initialized) {
if (!inviteCode) {
console.log('[Better Auth Hook] Public signup is disabled')
return ctx.json(
+2
View File
@@ -349,7 +349,9 @@ export class TeamService {
const count = await prisma.user.count()
return {
initialized: count > 0,
userCount: count,
demoMode: process.env.SHUMAI_DEMO_MODE === '1',
}
}