Refactor authentication system: replace NextAuth with custom login/logout/session handling, improve cookie management, and enhance error handling
Build and Push Reader Image / docker (push) Successful in 39s
Build and Push Reader Image / docker (push) Successful in 39s
This commit is contained in:
@@ -1,13 +1,8 @@
|
||||
import { getServerSession } from "next-auth/next"
|
||||
import { authOptions } from "@/lib/auth"
|
||||
import { redirect } from "next/navigation"
|
||||
import { requireModSessionUser } from "@/lib/server-auth"
|
||||
import { RecommendationClient } from "./recommendation-client"
|
||||
|
||||
export default async function ModRecommendationPage() {
|
||||
const session = await getServerSession(authOptions)
|
||||
if (!session || (session.user.role !== "MOD" && session.user.role !== "ADMIN")) {
|
||||
redirect("/")
|
||||
}
|
||||
await requireModSessionUser()
|
||||
|
||||
return <RecommendationClient />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user