diff --git a/app/api/data/companies-list/route.ts b/app/api/data/companies-list/route.ts index 0768a83..33dc84e 100644 --- a/app/api/data/companies-list/route.ts +++ b/app/api/data/companies-list/route.ts @@ -1,7 +1,11 @@ import { NextResponse } from 'next/server'; +import { requireAuth } from '@/lib/auth-utils'; import { postgresClient } from '@/lib/services/postgres-client'; export async function GET() { + const { error } = await requireAuth(); + if (error) return error; + try { const result = await postgresClient.query( `SELECT id, company_name FROM companies WHERE is_active = true AND is_deleted = false ORDER BY company_name ASC`