import { requireAdmin, type AuthContext } from './auth';

/**
 * Server-side super admin authentication check
 * Currently treats all admins as super admins, but can be extended
 */
export async function requireSuperAdmin(request: Request): Promise<AuthContext> {
  const auth = await requireAdmin(request);
  
  // For now, all admins are considered super admins
  // You can modify this logic to check for specific super admin roles/permissions
  if (!auth.isAdmin) {
    throw new Error('Super admin access required');
  }
  
  return auth;
}