fix(chat-deploy): fixed chat-deploy (#981)

This commit is contained in:
Waleed Latif
2025-08-15 13:07:54 -07:00
committed by GitHub
parent 9f02f88bf5
commit 03bb437e09

View File

@@ -73,7 +73,8 @@ export async function middleware(request: NextRequest) {
}
// For self-hosted deployments, redirect root path based on session status
if (!isHosted && url.pathname === '/') {
// Only apply redirects to the main domain, not subdomains
if (!isHosted && !isCustomDomain && url.pathname === '/') {
if (hasActiveSession) {
// User has active session, redirect to workspace
return NextResponse.redirect(new URL('/workspace', request.url))