feat: Redesign the home page hero section with a new background image and enhanced search UI, and standardize user dashboard routing across the application.
This commit is contained in:
@@ -2,7 +2,7 @@ import { auth } from "@/auth";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
// Public routes that don't require authentication
|
||||
const publicRoutes = ["/login", "/signup", "/forgot-password", "/reset-password", "/verify-email"];
|
||||
const publicRoutes = ["/login", "/signup", "/forgot-password", "/reset-password", "/verify-email", "/contact"];
|
||||
|
||||
export default auth((req) => {
|
||||
const { nextUrl } = req;
|
||||
@@ -43,7 +43,7 @@ export default auth((req) => {
|
||||
if (isLoggedIn) {
|
||||
// Prevent regular users from accessing agent routes
|
||||
if (isAgentRoute && userRole !== "AGENT") {
|
||||
return NextResponse.redirect(new URL("/user/userprofile", nextUrl.origin));
|
||||
return NextResponse.redirect(new URL("/user/userdashboard", nextUrl.origin));
|
||||
}
|
||||
|
||||
// Prevent agents from accessing user routes
|
||||
|
||||
Reference in New Issue
Block a user