From 9e3c13a514245da617be5f6d27f580946b3f1844 Mon Sep 17 00:00:00 2001 From: doomsayer31 Date: Fri, 28 Sep 2018 15:48:06 +0200 Subject: [PATCH] fixed login issue --- index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 6473eee..1afc1df 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ var request = require('request'), module.exports = function (username, password) { // Base url for all hover api requests - var baseUrl = 'https://www.hover.com/api'; + var baseUrl = 'https://www.hover.com/'; // Captured from cookie in hover authentication request. var cookies = request.jar(); @@ -146,10 +146,11 @@ module.exports = function (username, password) { // Issue login request with provided username / password r({ - uri: baseUrl + '/login', - body: 'username=' + username + '&password=' + password, + method: 'POST', + uri: baseUrl + '/signin', + body: {'username' : username , "password": password }, headers: { - 'Content-Type': 'application/x-www-form-urlencoded' + 'Content-Type': 'application/json;charset=UTF-8' } }, _rCallback(function (err) { if (err) return cb(err); @@ -179,7 +180,7 @@ module.exports = function (username, password) { // Default options var options = { method: method, - uri: baseUrl + path + uri: baseUrl + '/api' + path }; // Add body if provided