Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions apps/web/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ export async function middleware(request: NextRequest) {
secret: process.env.NEXTAUTH_SECRET,
});

// Unauthenticated visitors at root get redirected to the marketing site
if (!token && request.nextUrl.pathname === "/") {
const wwwUrl = process.env.NEXT_PUBLIC_WWW_URL || "https://openvpm.com";
return NextResponse.redirect(wwwUrl);
}

// Unauthenticated visitors go to the demo login, which offers one-click
// demo access. (Previously the root path bounced to the marketing site,
// which dead-ended anyone who came straight to demo.openvpm.com to try it.)
if (!token) {
const loginUrl = new URL("/login", request.url);
return NextResponse.redirect(loginUrl);
Expand Down
Loading
Loading