Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

resolved comments

jeet1desai531ee396f92b
diff --git a/lib/middleware/domain.ts b/lib/middleware/domain.ts
index 8d7c3bc3..6d04e22a 100644
--- a/lib/middleware/domain.ts
+++ b/lib/middleware/domain.ts
@@ -1,10 +1,8 @@
import { NextRequest, NextResponse } from "next/server";
-import { getToken } from "next-auth/jwt";
import { PAPERMARK_HEADERS } from "../constants";
export default async function DomainMiddleware(req: NextRequest) {
const path = req.nextUrl.pathname;
- const host = req.headers.get("host");
// clone the URL so we can modify it
const url = req.nextUrl.clone();
@@ -12,7 +10,7 @@ export default async function DomainMiddleware(req: NextRequest) {
// if there's a path and it's not "/" then we need to check if it's a custom domain
if (path !== "/") {
// Subdomain available, rewriting
- url.pathname = `/view/domains/${host}${path}`;
+ url.pathname = `${path}`;
return NextResponse.rewrite(url, PAPERMARK_HEADERS);
} else {
// redirect plain custom domain to papermark.io, eventually to it's own landing page
diff --git a/pages/api/teams/[teamId]/domains/[domain]/verify.ts b/pages/api/teams/[teamId]/domains/[domain]/verify.ts
index 7f0ed44d..c27b244c 100644
--- a/pages/api/teams/[teamId]/domains/[domain]/verify.ts
+++ b/pages/api/teams/[teamId]/domains/[domain]/verify.ts
@@ -80,7 +80,7 @@ export default async function handle(
await trackAnalytics({
event: "Domain Verified",
slug: domain,
- }).then(() => {});
+ });
}
}