Skip to content

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

PM:139 update redirection to dashboard

Ashish Viradiyaba0338b131af
diff --git a/components/sidebar/app-sidebar.tsx b/components/sidebar/app-sidebar.tsx
index dae858a8..d387b45f 100644
--- a/components/sidebar/app-sidebar.tsx
+++ b/components/sidebar/app-sidebar.tsx
@@ -14,6 +14,7 @@ import {
CogIcon,
ContactIcon,
FolderIcon,
+ HouseIcon,
Loader,
ServerIcon,
} from "lucide-react";
@@ -59,12 +60,12 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
const data = {
navMain: [
- // {
- // title: "Dashboard",
- // url: "/dashboard",
- // icon: HouseIcon,
- // current: router.pathname.includes("dashboard"),
- // },
+ {
+ title: "Dashboard",
+ url: "/dashboard",
+ icon: HouseIcon,
+ current: router.pathname.includes("dashboard"),
+ },
{
title: "All Documents",
url: "/documents",
diff --git a/lib/middleware/app.ts b/lib/middleware/app.ts
index 944f9fee..f623394f 100644
--- a/lib/middleware/app.ts
+++ b/lib/middleware/app.ts
@@ -35,9 +35,9 @@ export default async function AppMiddleware(req: NextRequest) {
return NextResponse.redirect(new URL("/welcome", req.url));
}
- // AUTHENTICATED if the path is /login, redirect to "/documents"
+ // AUTHENTICATED if the path is /login, redirect to "/dashboard"
if (token?.email && path === "/login") {
- const nextPath = url.searchParams.get("next") || "/documents"; // Default redirection to "/documents" if no next parameter
+ const nextPath = url.searchParams.get("next") || "/dashboard"; // Default redirection to "/dashboard" if no next parameter
return NextResponse.redirect(
new URL(decodeURIComponent(nextPath), req.url),
);
diff --git a/next.config.mjs b/next.config.mjs
index a33c2ab3..b5b2a1c8 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -17,7 +17,7 @@ const nextConfig = {
return [
{
source: "/",
- destination: "/documents",
+ destination: "/dashboard",
permanent: false,
},
{