Skip to content

Commit

Permalink
#668 switch to POST
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Jul 12, 2018
1 parent 536254f commit c952f99
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions www/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,9 +1032,21 @@ angular.module('zmApp', [


//first login using new API
var loginAPI = loginData.apiurl + '/host/login.json?user=' + loginData.username + "&pass=" + loginData.password;

$http.get(loginAPI)
var loginAPI = loginData.apiurl + '/host/login.json';

$http({
method:'POST',
url: loginAPI,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
transformRequest: function(obj) {
var str = [];
for(var p in obj)
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
return str.join("&");
},
data: {user: loginData.username, pass: loginData.password}
})
//$http.get(loginAPI)
.then(function (succ) {

NVRDataModel.debug ("API based login returned: "+JSON.stringify(succ));
Expand Down

0 comments on commit c952f99

Please sign in to comment.