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.

update public routes

Steven Tey0f2770ecb317
diff --git a/apps/web/lib/middleware/app.ts b/apps/web/lib/middleware/app.ts
index db333bbdc4..27ec856707 100644
--- a/apps/web/lib/middleware/app.ts
+++ b/apps/web/lib/middleware/app.ts
@@ -22,7 +22,7 @@ export async function AppMiddleware(req: NextRequest) {
const user = await getUserViaToken(req);
- // if there's no user and the path isn't /login or /register, redirect to /login
+ // if there's no user and the path is not a public page, redirect to /login
if (
!user &&
path !== "/login" &&
@@ -31,7 +31,8 @@ export async function AppMiddleware(req: NextRequest) {
path !== "/auth/saml" &&
!path.startsWith("/auth/reset-password/") &&
!path.startsWith("/share/") &&
- !path.startsWith("/deeplink/")
+ !path.startsWith("/deeplink/") &&
+ !path.startsWith("/unsubscribe/")
) {
return NextResponse.redirect(
new URL(