@@ -470,7 +473,7 @@ export function CommonHeader() {
{/* Mobile Navigation Menu */}
{showMobileMenu && (
- {/* */}
)}
diff --git a/src/middleware.ts b/src/middleware.ts
index 5e136fe..6f19c1e 100644
--- a/src/middleware.ts
+++ b/src/middleware.ts
@@ -2,10 +2,30 @@ import { auth } from "@/auth";
import { NextResponse } from "next/server";
// Auth routes - logged-in users should be redirected away from these
-const authRoutes = ["/login", "/signup", "/forgot-password", "/reset-password", "/verify-email"];
+const authRoutes = [
+ "/login",
+ "/signup",
+ "/forgot-password",
+ "/reset-password",
+ "/verify-email",
+];
// Public routes - accessible to everyone (logged in or not)
-const publicRoutes = ["/", "/contact", "/about", "/faq", "/education", "/coming-soon", "/privacy-policy", "/terms-of-service", "/logout", "/user/dashboard", "/user/profiles", "/user/profile"];
+const publicRoutes = [
+ "/",
+ "/home",
+ "/contact",
+ "/about",
+ "/faq",
+ "/education",
+ "/coming-soon",
+ "/privacy-policy",
+ "/terms-of-service",
+ "/logout",
+ "/user/dashboard",
+ "/user/profiles",
+ "/user/profile",
+];
// Routes that should NEVER be redirected away from (even if logged in)
const noRedirectRoutes = ["/logout"];
@@ -16,23 +36,27 @@ export default auth((req) => {
const userRole = (req.auth?.user as any)?.role;
const isAuthRoute = authRoutes.some(
- (route) => nextUrl.pathname === route || nextUrl.pathname.startsWith(route + "/")
+ (route) =>
+ nextUrl.pathname === route || nextUrl.pathname.startsWith(route + "/"),
);
const isPublicRoute = publicRoutes.some(
- (route) => nextUrl.pathname === route || nextUrl.pathname.startsWith(route + "/")
+ (route) =>
+ nextUrl.pathname === route || nextUrl.pathname.startsWith(route + "/"),
);
const isAgentRoute = nextUrl.pathname.startsWith("/agent");
const isUserRoute = nextUrl.pathname.startsWith("/user");
const isApiRoute = nextUrl.pathname.startsWith("/api");
- const isStaticRoute = nextUrl.pathname.startsWith("/_next") ||
- nextUrl.pathname.startsWith("/assets") ||
- nextUrl.pathname.includes(".");
+ const isStaticRoute =
+ nextUrl.pathname.startsWith("/_next") ||
+ nextUrl.pathname.startsWith("/assets") ||
+ nextUrl.pathname.includes(".");
const isNoRedirectRoute = noRedirectRoutes.some(
- (route) => nextUrl.pathname === route || nextUrl.pathname.startsWith(route + "/")
+ (route) =>
+ nextUrl.pathname === route || nextUrl.pathname.startsWith(route + "/"),
);
// Skip middleware for API routes and static files