diff --git a/next.config.mjs b/next.config.mjs index 3811d3f..ff48f27 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,17 +1,21 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - - images: { - remotePatterns: [ - { - protocol: 'https', - hostname: 'tedx-sjec.github.io', - port: '', - pathname: '/**', - }, - ], - }, - + images: { + remotePatterns: [ + { + protocol: "https", + hostname: "tedx-sjec.github.io", + port: "", + pathname: "/**", + }, + { + protocol: "https", + hostname: "startup-template-sage.vercel.app", + port: "", + pathname: "/**", + }, + ], + }, }; export default nextConfig; diff --git a/src/components/navbar/nav-items.tsx b/src/components/navbar/nav-items.tsx index c0da8c4..f386673 100644 --- a/src/components/navbar/nav-items.tsx +++ b/src/components/navbar/nav-items.tsx @@ -26,10 +26,5 @@ const NavItem = ({ href, textOne, textTwo }: NavItemProps) => { ); }; -NavItem.defaultProps = { - href: "#", - textOne: "ABOUT", - textTwo: "ABOUT", -}; export default NavItem; diff --git a/src/middleware.ts b/src/middleware.ts index 8551210..789c960 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -13,9 +13,14 @@ export async function middleware(request: NextRequest) { return NextResponse.redirect(new URL("/", request.url)); } } + if (url.pathname.startsWith("/register")) { + if (token?.role !== "ADMIN") { + return NextResponse.redirect(new URL("/", request.url)); + } + } } // See "Matching Paths" below to learn more export const config = { - matcher: ["/:path*", "/"], + matcher: ["/:path*", "/", "/admin/:path*", "/register/:path*"], };