mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
feat(auth): remove enablePublicSignup and disable public signup in UI
This commit is contained in:
@@ -31,7 +31,7 @@ export const auth = betterAuth({
|
||||
const info = await teamService.getSignupInfo()
|
||||
|
||||
if (info.userCount > 0) {
|
||||
if (!inviteCode && !info.enablePublicSignup) {
|
||||
if (!inviteCode) {
|
||||
console.log('[Better Auth Hook] Public signup is disabled')
|
||||
return ctx.json(
|
||||
{
|
||||
|
||||
@@ -15,7 +15,6 @@ describe('CollectionService', () => {
|
||||
data: {
|
||||
name: 'Test Team',
|
||||
settings: {
|
||||
enablePublicSignup: true,
|
||||
transcode: { videoStrategy: 'best_match' },
|
||||
},
|
||||
sandbox: { create: {} },
|
||||
|
||||
@@ -26,7 +26,6 @@ export class TeamService {
|
||||
data: {
|
||||
name: 'Default Team',
|
||||
settings: {
|
||||
enablePublicSignup: true,
|
||||
transcode: { videoStrategy: 'best_match' },
|
||||
},
|
||||
sandbox: { create: {} },
|
||||
@@ -249,14 +248,9 @@ export class TeamService {
|
||||
|
||||
async getSignupInfo() {
|
||||
const count = await prisma.user.count()
|
||||
const defaultTeam = await this.ensureDefaultTeam()
|
||||
const settings = defaultTeam.settings as {
|
||||
enablePublicSignup?: boolean
|
||||
} | null
|
||||
|
||||
return {
|
||||
userCount: count,
|
||||
enablePublicSignup: settings?.enablePublicSignup ?? false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user