The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
add redirects for workspace sections
Steven Tey8d02e848bcea
diff --git a/apps/web/app/app.dub.co/(dashboard)/settings/layout.tsx b/apps/web/app/app.dub.co/(dashboard)/account/settings/layout.tsxsimilarity index 100%rename from apps/web/app/app.dub.co/(dashboard)/settings/layout.tsxrename to apps/web/app/app.dub.co/(dashboard)/account/settings/layout.tsxdiff --git a/apps/web/app/app.dub.co/(dashboard)/settings/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/account/settings/page-client.tsxsimilarity index 100%rename from apps/web/app/app.dub.co/(dashboard)/settings/page-client.tsxrename to apps/web/app/app.dub.co/(dashboard)/account/settings/page-client.tsxdiff --git a/apps/web/app/app.dub.co/(dashboard)/settings/page.tsx b/apps/web/app/app.dub.co/(dashboard)/account/settings/page.tsxsimilarity index 100%rename from apps/web/app/app.dub.co/(dashboard)/settings/page.tsxrename to apps/web/app/app.dub.co/(dashboard)/account/settings/page.tsxdiff --git a/apps/web/app/app.dub.co/(dashboard)/settings/tokens/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/account/settings/tokens/page-client.tsxsimilarity index 100%rename from apps/web/app/app.dub.co/(dashboard)/settings/tokens/page-client.tsxrename to apps/web/app/app.dub.co/(dashboard)/account/settings/tokens/page-client.tsxdiff --git a/apps/web/app/app.dub.co/(dashboard)/settings/tokens/page.tsx b/apps/web/app/app.dub.co/(dashboard)/account/settings/tokens/page.tsxsimilarity index 100%rename from apps/web/app/app.dub.co/(dashboard)/settings/tokens/page.tsxrename to apps/web/app/app.dub.co/(dashboard)/account/settings/tokens/page.tsxdiff --git a/apps/web/lib/middleware/app.ts b/apps/web/lib/middleware/app.tsindex fc599200d7..2c401188cd 100644--- a/apps/web/lib/middleware/app.ts+++ b/apps/web/lib/middleware/app.ts@@ -42,12 +42,19 @@ export default async function AppMiddleware(req: NextRequest) {return NextResponse.redirect(new URL("/welcome", req.url));// if the path is / or /login or /register, redirect to the default workspace- } else if (path === "/" || path === "/login" || path === "/register") {+ } else if (+ path === "/" ||+ path === "/login" ||+ path === "/register" ||+ path.startsWith("/analytics") ||+ path.startsWith("/integrations") ||+ path.startsWith("/settings")+ ) {const defaultWorkspace = await getDefaultWorkspace(user);if (defaultWorkspace) {return NextResponse.redirect(- new URL(`/${defaultWorkspace}${searchParamsString}`, req.url),+ new URL(`/${defaultWorkspace}${path}${searchParamsString}`, req.url),);} else {return NextResponse.redirect(new URL("/workspaces", req.url));diff --git a/apps/web/ui/layout/settings-nav-link.tsx b/apps/web/ui/layout/settings-nav-link.tsxindex 85d640fd5e..95351e63d6 100644--- a/apps/web/ui/layout/settings-nav-link.tsx+++ b/apps/web/ui/layout/settings-nav-link.tsx@@ -20,7 +20,7 @@ export default function NavLink({slug?: string;};- const href = `${slug ? `/${slug}` : ""}/settings${+ const href = `${slug ? `/${slug}` : "/account"}/settings${segment ? `/${segment}` : ""}`;diff --git a/apps/web/ui/layout/user-dropdown.tsx b/apps/web/ui/layout/user-dropdown.tsxindex 831dcae140..f82e812259 100644--- a/apps/web/ui/layout/user-dropdown.tsx+++ b/apps/web/ui/layout/user-dropdown.tsx@@ -51,7 +51,7 @@ export default function UserDropdown() {/></Link><Link- href="/settings"+ href="/account/settings"onClick={() => setOpenPopover(false)}className="block w-full rounded-md p-2 text-sm transition-all duration-75 hover:bg-gray-100 active:bg-gray-200">diff --git a/apps/web/ui/modals/google-oauth-modal.tsx b/apps/web/ui/modals/google-oauth-modal.tsxindex dee4c0f29f..13e1865de5 100644--- a/apps/web/ui/modals/google-oauth-modal.tsx+++ b/apps/web/ui/modals/google-oauth-modal.tsx@@ -45,7 +45,7 @@ function GoogleOauthModal({onClick={() => {setClickedGoogle(true);signIn("google", {- callbackUrl: "/settings?google=true",+ callbackUrl: "/account/settings?google=true",});}}loading={clickedGoogle}