This commit is contained in:
dong.huo 2026-04-20 18:47:54 +00:00 committed by GitHub
commit 5be60a43c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,10 +1,9 @@
import { getToken } from "next-auth/jwt"
import { withAuth } from "next-auth/middleware"
import { NextResponse } from "next/server"
export default withAuth(
async function middleware(req) {
const token = await getToken({ req })
const { token } = req.nextauth
const isAuth = !!token
const isAuthPage =
req.nextUrl.pathname.startsWith("/login") ||