diff options
Diffstat (limited to 'client/js/services/Identity.js')
| -rw-r--r-- | client/js/services/Identity.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/client/js/services/Identity.js b/client/js/services/Identity.js index da85ecd..f9d1df4 100644 --- a/client/js/services/Identity.js +++ b/client/js/services/Identity.js @@ -1,5 +1,5 @@ -mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ +mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ /* Create profile structure to store informations * about current session @@ -27,9 +27,12 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ && typeof tokenPart_1InCookie !== 'undefined' ){ - // If yes, put it into variables - angular.extend(profile, profileInCookie); - token=tokenPart_0InCookie+tokenPart_1InCookie; + if(token!==null){ + // If yes, put it into variables + angular.extend(profile, profileInCookie); + token=tokenPart_0InCookie+tokenPart_1InCookie; + + } // Return I'm Login return true; @@ -51,6 +54,9 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ token=null; profile.username=null; profile.projectname=null; + + // Reload Page + location.reload(); } @@ -95,6 +101,7 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ else{ requestParserResult.failReason="Please check your username, password and project name !"; } + return requestParserResult; }; |
