From c84f4aca92bde9465d481314d519fc23a46e04d5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 12 Jul 2016 14:28:15 +0200 Subject: [PATCH] Support http-basic-auth via basicAuth setting use settings.basicAuth.username and settings.basicAuth.password to configure basic authentication. --- lib/wordpress.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/wordpress.js b/lib/wordpress.js index 205472c..9663607 100644 --- a/lib/wordpress.js +++ b/lib/wordpress.js @@ -44,7 +44,11 @@ function Client( settings ) { // via settings.host headers: { Host: parsedUrl.host - } + }, + basic_auth: settings.basicAuth ? { + user: settings.basicAuth.username, + pass: settings.basicAuth.password + } : null, }); this.blogId = settings.blogId || 0; this.username = settings.username;