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 workspaces.ts

Steven Teye04e5c9687d4
diff --git a/apps/web/lib/middleware/workspaces.ts b/apps/web/lib/middleware/workspaces.ts
index 2140ffda8b..f474511261 100644
--- a/apps/web/lib/middleware/workspaces.ts
+++ b/apps/web/lib/middleware/workspaces.ts
@@ -11,7 +11,8 @@ export default async function WorkspacesMiddleware(
const { path, searchParamsObj, searchParamsString } = parse(req);
// special case for handling ?next= query param
- if (searchParamsObj.next) {
+ // only redirect if next is a valid relative path (not an absolute URL)
+ if (searchParamsObj.next && searchParamsObj.next.startsWith("/")) {
return NextResponse.redirect(new URL(searchParamsObj.next, req.url));
}