import { NextRequest, NextResponse } from 'next/server';

export async function GET(req: NextRequest) {
  // In a real app, this would verify the JWT token from headers or session cookie.
  // For this mock, we assume the middleware handled the primary check,
  // or a client component sends a token to be verified.
  const token = req.cookies.get('adminToken')?.value || req.headers.get('Authorization')?.split(' ')[1];

  if (token === 'mock-admin-token') {
    return NextResponse.json({ isAuthenticated: true, role: 'admin' }, { status: 200 });
  } else {
    return NextResponse.json({ isAuthenticated: false }, { status: 401 });
  }
}