mirror of
https://github.com/shadcn-ui/taxonomy
synced 2026-05-23 09:18:30 +00:00
14 lines
339 B
TypeScript
14 lines
339 B
TypeScript
import { withAuth } from "next-auth/middleware"
|
|
|
|
import { getSession } from "@/lib/session"
|
|
|
|
export default withAuth({
|
|
callbacks: {
|
|
async authorized({ req }) {
|
|
const session = await getSession(req.headers.get("cookie"))
|
|
return !!session
|
|
},
|
|
},
|
|
})
|
|
|
|
export const config = { matcher: ["/dashboard/:path*", "/editor"] }
|