Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

exclude share pages from login

Steven Tey0751f210192c
diff --git a/apps/web/app/app.dub.co/(share)/layout.tsx b/apps/web/app/app.dub.co/(share)/layout.tsx
index 7621f75ebb..5efd77a80e 100644
--- a/apps/web/app/app.dub.co/(share)/layout.tsx
+++ b/apps/web/app/app.dub.co/(share)/layout.tsx
@@ -1,7 +1,7 @@
import { Footer, Nav, NavMobile } from "@dub/ui";
import { ReactNode } from "react";
-export default function ShareAnalyticsLayout({
+export default function SharedDashboardLayout({
children,
}: {
children: ReactNode;
diff --git a/apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx b/apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx
index 6fe4669c03..683cd0bf55 100644
--- a/apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx
+++ b/apps/web/app/app.dub.co/(share)/share/[dashboardId]/page.tsx
@@ -33,7 +33,7 @@ export async function generateMetadata({
});
}
-export default async function SharePage({
+export default async function SharedDashboardPage({
params,
}: {
params: { dashboardId: string };
diff --git a/apps/web/lib/middleware/app.ts b/apps/web/lib/middleware/app.ts
index 1c640fe342..eab8091951 100644
--- a/apps/web/lib/middleware/app.ts
+++ b/apps/web/lib/middleware/app.ts
@@ -20,7 +20,8 @@ export default async function AppMiddleware(req: NextRequest) {
path !== "/forgot-password" &&
path !== "/register" &&
path !== "/auth/saml" &&
- !path.startsWith("/auth/reset-password/")
+ !path.startsWith("/auth/reset-password/") &&
+ !path.startsWith("/share/")
) {
return NextResponse.redirect(
new URL(