11 lines
279 B
TypeScript
11 lines
279 B
TypeScript
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")
|
|
}
|
|
|
|
return <>{children}</>
|
|
}
|