feat(registration): allow self-hosted users to disable registration altogether (#2365)

* feat(registration): allow self-hosted users to disable registration altogether

* updated tests

* fix build
This commit is contained in:
Waleed
2025-12-13 17:34:53 -08:00
committed by GitHub
parent 746ff68a2e
commit 95b9ca4670
66 changed files with 332 additions and 154 deletions

View File

@@ -1,6 +1,6 @@
import { getSessionCookie } from 'better-auth/cookies'
import { type NextRequest, NextResponse } from 'next/server'
import { isHosted } from './lib/core/config/environment'
import { isAuthDisabled, isHosted } from './lib/core/config/feature-flags'
import { generateRuntimeCSP } from './lib/core/security/csp'
import { createLogger } from './lib/logs/console/logger'
@@ -135,7 +135,7 @@ export async function proxy(request: NextRequest) {
const url = request.nextUrl
const sessionCookie = getSessionCookie(request)
const hasActiveSession = !!sessionCookie
const hasActiveSession = isAuthDisabled || !!sessionCookie
const redirect = handleRootPathRedirects(request, hasActiveSession)
if (redirect) return redirect