diff options
| author | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-02-10 19:28:31 +0100 |
|---|---|---|
| committer | manzerbredes <loic.guegan_secondary@yahoo.fr> | 2016-02-10 19:28:31 +0100 |
| commit | e026ce21b48eddc9c4ca03b441d03baff217d3ad (patch) | |
| tree | d443ab68da70a766d34dcc3e9168c9a8ca67f38f /client/js/services | |
| parent | 7b9f17ba036f016078aea27565e1d31fce586b3f (diff) | |
| parent | 0c985435949c1b7cd034d70559f8bcce744418de (diff) | |
Merge branch 'loic' into develop
Diffstat (limited to 'client/js/services')
| -rw-r--r-- | client/js/services/Identity.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/js/services/Identity.js b/client/js/services/Identity.js index 7021003..509f800 100644 --- a/client/js/services/Identity.js +++ b/client/js/services/Identity.js @@ -7,6 +7,8 @@ mainApp.factory('Identity',[ '$http', function($http){ profile.projectname="Undefined"; profile.token=""; + /* Will contain the result of the $http request */ + var $httpResponse; /** * Function to connect to OpenStack @@ -21,8 +23,9 @@ mainApp.factory('Identity',[ '$http', function($http){ profile.username=username; profile.projectname=projectname; - return $http.post('../server/index.php', + $httpResponse=$http.post('../server/index.php', $.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname})); + return $httpResponse; }; @@ -45,11 +48,15 @@ mainApp.factory('Identity',[ '$http', function($http){ }; + var getResponse=function(){ + return parseLoginAnswer($httpResponse); + } + // Return services objects return { login: login, - parseLoginAnswer: parseLoginAnswer, + getResponse: getResponse, profile: profile }; |
