A higher-order function for Next.js API routes that automatically handles encrypted credential retrieval and injection