17 lines
300 B
TypeScript
17 lines
300 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { auth } from "@clerk/nextjs/server";
|
|
|
|
export default async function ContactsLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
const { userId } = await auth();
|
|
|
|
if (!userId) {
|
|
redirect("/sign-in");
|
|
}
|
|
|
|
return <>{children}</>;
|
|
}
|