Authentication And Serive Engineer Portal is added
This commit is contained in:
@@ -1,7 +1,17 @@
|
||||
// app/dashboard/page.tsx
|
||||
import { redirect } from "next/navigation";
|
||||
import { getServerSession } from "next-auth/next";
|
||||
import { authOptions } from "@/app/api/auth/[...nextauth]/route"; // Changed from handler to authOptions
|
||||
|
||||
export default function DashboardBasePage() {
|
||||
// Automatically redirect the user to the actual overview dashboard page
|
||||
redirect("/dashboard/overview/dashboard");
|
||||
}
|
||||
export default async function DashboardBasePage() {
|
||||
|
||||
const session = await getServerSession(authOptions);
|
||||
|
||||
if (!session) {
|
||||
redirect("/login");
|
||||
}
|
||||
else{
|
||||
redirect("/dashboard/overview/dashboard");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user