chore(admin): in dev require only authenticated session for /admin to simplify local testing; prod still requires admin
This commit is contained in:
parent
8fb2e4caaf
commit
4f03433afe
1 changed files with 8 additions and 2 deletions
|
|
@ -1,11 +1,17 @@
|
|||
import { ReactNode } from "react"
|
||||
|
||||
import { requireAdminSession } from "@/lib/auth-server"
|
||||
import { requireAdminSession, requireAuthenticatedSession } from "@/lib/auth-server"
|
||||
|
||||
export const dynamic = "force-dynamic"
|
||||
export const runtime = "nodejs"
|
||||
|
||||
export default async function AdminLayout({ children }: { children: ReactNode }) {
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
await requireAdminSession()
|
||||
} else {
|
||||
// Em desenvolvimento, basta estar autenticado para acessar a área admin,
|
||||
// facilitando validação local sem depender do papel exato do usuário.
|
||||
await requireAuthenticatedSession()
|
||||
}
|
||||
return <>{children}</>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue