17 lines
389 B
TypeScript
17 lines
389 B
TypeScript
import React from "react";
|
|
import { redirect } from "next/navigation";
|
|
|
|
import { verifySession } from "@/lib/server_functions/dataAccessLayer";
|
|
|
|
export default async function ProtectedRoute({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const session = await verifySession();
|
|
if (!session.isAuthed) {
|
|
redirect("/Authentication/Login");
|
|
}
|
|
|
|
return <div>{children}</div>;
|
|
}
|