PreRelease v1
This commit is contained in:
16
app/(dashboard)/contacts/layout.tsx
Normal file
16
app/(dashboard)/contacts/layout.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
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}</>;
|
||||
}
|
||||
Reference in New Issue
Block a user