import { NextRequest } from 'next/server';

export default function validateApiKey(request: NextRequest) {
  const envApiKey = process.env.JOBS_API_TOKEN;
  const requestApiKey = request.headers.get('x-jobs-api-key');
  if (requestApiKey !== envApiKey) {
    throw new Error('Unauthorized');
  }
}
