From 57cbf886fcd771aac3196966ff9cfee2e5c9fbb2 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 3 May 2018 12:23:02 -0400 Subject: credential API consistency --- www/js/DataModel.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index ed6e5b96..97bbe4fd 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -340,25 +340,25 @@ angular.module('zmApp.controllers') // disable for now, getAuthHash needs work - if (versionCompare(currentServerVersion, "1.31.41") != -1 ) { + if (versionCompare(currentServerVersion, "1.31.44") != -1 ) { myurl = loginData.apiurl+'/host/getCredentials.json'; debug ("Server version > 1.31.41, so using getCredentials API:"+myurl); $http.get(myurl) .then (function (s) { - console.log ("GOT " + JSON.stringify(s)); - if (!s.data || !s.data.auth_key ) { + debug("Credentials API returned: " + JSON.stringify(s)); + if (!s.data || !s.data.credentials ) { $rootScope.authSession = "undefined"; d.resolve($rootScope.authSession); - debug ("AuthHash API Succeded, but did NOT return auth_key key: "+JSON.stringify(s)); + debug ("getCredentials() API Succeded, but did NOT return credentials key: "+JSON.stringify(s)); return d.promise; } else { - $rootScope.authSession = "&"+s.data.auth_key; + $rootScope.authSession = "&"+s.data.credentials; if (s.data.append_password=='1') { - $rootScope.athSession = $rootScope.authSession + + $rootScope.authSession = $rootScope.authSession + loginData.password; } d.resolve($rootScope.authSession); -- cgit v1.2.3