From fc3d6c1dd07d54fad10a9af7c46531f26a18c3da Mon Sep 17 00:00:00 2001 From: Frederic Germain Date: Mon, 25 Sep 2017 11:31:44 +0200 Subject: [PATCH] use node comptatible API for json fix: https://github.com/pouchdb-community/pouchdb-authentication/issues/127 https://github.com/pouchdb-community/pouchdb-authentication/issues/130 --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index fedb3c1..5e35a94 100644 --- a/lib/index.js +++ b/lib/index.js @@ -86,8 +86,8 @@ exports.login = utils.toPromise(function (username, password, opts, callback) { var ajaxOpts = utils.extend(true, { method : 'POST', url : utils.getSessionUrl(db), - headers : {'Content-Type': 'application/json'}, - body : JSON.stringify({name: username, password: password}) + json: true, + body : {name: username, password: password} }, opts.ajax || {}); utils.ajax(ajaxOpts, wrapError(callback)); });