chore: remove next-auth, use simple auth
This commit is contained in:
+2
-6
@@ -1,12 +1,8 @@
|
||||
import { auth } from '@/lib/auth'
|
||||
import { NextResponse } from 'next/server'
|
||||
|
||||
// NextAuth kaldırıldı — admin koruması şimdilik açık
|
||||
export async function requireAdmin() {
|
||||
const session = await auth()
|
||||
if (!session || (session.user as { role?: string }).role !== 'ADMIN') {
|
||||
throw new Error('Unauthorized')
|
||||
}
|
||||
return session
|
||||
// İleride env-based token veya başka auth mekanizması eklenebilir
|
||||
}
|
||||
|
||||
export function unauthorized() {
|
||||
|
||||
Reference in New Issue
Block a user