From 830fc4060ead08440482a89c1adb823d45e78b37 Mon Sep 17 00:00:00 2001 From: "Didier Villevalois (Ptitjes)" Date: Sun, 12 Nov 2017 18:26:45 +0100 Subject: [PATCH] fix(nodejs): correctly set ajax request's body for login Fixes #127, #130 and #141 --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index be832fa..610a67e 100644 --- a/src/index.js +++ b/src/index.js @@ -114,7 +114,7 @@ plugin.login = toPromise(function (username, password, opts, callback) { method : 'POST', url : getSessionUrl(db), headers : {'Content-Type': 'application/json'}, - body : JSON.stringify({name: username, password: password}) + body : {name: username, password: password} }, opts.ajax || {}); ajaxCore(ajaxOpts, wrapError(callback)); });