mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
11 lines
323 B
TypeScript
11 lines
323 B
TypeScript
// export { auth as default } from "auth"
|
|
import { auth } from "auth"
|
|
import { NextResponse } from "next/server"
|
|
|
|
export default auth((req) => {
|
|
if (req.auth) return NextResponse.json(req.auth)
|
|
return NextResponse.json("Not authorized", { status: 401 })
|
|
})
|
|
|
|
export const config = { matcher: ["/middleware-protected"] }
|