You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Drift/client/app/(posts)/new/layout.tsx

12 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}</>
}