mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
* docs: add Gatsby example, move Next.js example * chore: fix sync action * docs(example): fix README link
9 lines
260 B
TypeScript
9 lines
260 B
TypeScript
import { withAuth } from "next-auth/middleware"
|
|
|
|
// More on how NextAuth.js middleware works: https://next-auth.js.org/configuration/nextjs#middleware
|
|
export default withAuth({
|
|
callbacks: {
|
|
authorized: ({ token }) => token?.userRole === "admin",
|
|
},
|
|
})
|