diff options
| author | Yoggzo <yogg@epsina.com> | 2016-03-02 10:58:01 +0100 |
|---|---|---|
| committer | Yoggzo <yogg@epsina.com> | 2016-03-02 10:58:01 +0100 |
| commit | d1bd9b4a0c3168eec28ea1c3992748afe1953218 (patch) | |
| tree | 538ef3d0b37e1dcb0528ce6395c3a82a672a5089 /client/js/services/Identity.js | |
| parent | ae1100c16880d4bae77513ec433ac6734da8dea4 (diff) | |
| parent | b6d7d2c30efe5e9758072bb82ea3a947bda7fd1d (diff) | |
Merge branch 'develop' into Evan
Diffstat (limited to 'client/js/services/Identity.js')
| -rw-r--r-- | client/js/services/Identity.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/client/js/services/Identity.js b/client/js/services/Identity.js index b1d2a48..da85ecd 100644 --- a/client/js/services/Identity.js +++ b/client/js/services/Identity.js @@ -48,6 +48,9 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ $cookies.remove('profile'); $cookies.remove('token.part_0'); $cookies.remove('token.part_1'); + token=null; + profile.username=null; + profile.projectname=null; } @@ -81,6 +84,10 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ $cookies.putObject('token.part_0', response.data.token.substring(0, middle), {'expires': expireDate}); // Save second part of token $cookies.putObject('token.part_1', response.data.token.substring(middle, response.data.token.length), {'expires': expireDate}); + + // Put token in var + token=response.data.token; + } else if(failedToSendRequest){ requestParserResult.failReason="Failed to send request"; @@ -102,7 +109,7 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ * @param {string} projectname The user project name * @param {function} function to call when data is avalaible */ - var login=function(username, password,projectname, callback){ + var login=function(username, password,projectname,callback){ // Set profile information (early) profile.username=username; @@ -120,6 +127,9 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ }; + + + /* * Get the profile */ @@ -133,6 +143,7 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ var getToken=function(){ return token; } + // Return services objects |
