21 lines
382 B
TypeScript
21 lines
382 B
TypeScript
import { redirect } from "next/navigation";
|
|
|
|
import { getAdminSession, getUserSession } from "@/lib/session";
|
|
|
|
export default async function Home() {
|
|
const [adminSession, userSession] = await Promise.all([
|
|
getAdminSession(),
|
|
getUserSession(),
|
|
]);
|
|
|
|
if (adminSession) {
|
|
redirect("/admin");
|
|
}
|
|
|
|
if (userSession) {
|
|
redirect("/me");
|
|
}
|
|
|
|
redirect("/login");
|
|
}
|