CoastalCommitsPastes/client/app/(posts)/new/layout.tsx

12 lines
279 B
TypeScript
Raw Normal View History

import { getCurrentUser } from "@lib/server/session"
import { redirect } from "next/navigation"
export default function NewLayout({ children }: { children: React.ReactNode }) {
const user = getCurrentUser()
if (!user) {
return redirect("/new")
}
2022-11-10 02:11:36 -05:00
return <>{children}</>
}