diff options
Diffstat (limited to 'app/common/services/userModel.js')
-rw-r--r-- | app/common/services/userModel.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/common/services/userModel.js b/app/common/services/userModel.js index f73c7a8..ca90165 100644 --- a/app/common/services/userModel.js +++ b/app/common/services/userModel.js @@ -11,8 +11,8 @@ window.angular && (function(angular) { 'use strict'; angular.module('app.common.services').service('userModel', [ - 'APIUtils', - function(APIUtils) { + '$cookies', 'APIUtils', + function($cookies, APIUtils) { return { login: function(username, password, callback) { APIUtils.login(username, password, function(response, error) { @@ -35,7 +35,9 @@ window.angular && (function(angular) { }); }, isLoggedIn: function() { - if (sessionStorage.getItem('LOGIN_ID') === null) { + if ((sessionStorage.getItem('LOGIN_ID') === null) && + (($cookies.get('IsAuthenticated') === undefined) || + ($cookies.get('IsAuthenticated') == 'false'))) { return false; } return true; @@ -46,6 +48,7 @@ window.angular && (function(angular) { response.status == APIUtils.API_RESPONSE.SUCCESS_STATUS) { sessionStorage.removeItem('LOGIN_ID'); sessionStorage.removeItem(APIUtils.HOST_SESSION_STORAGE_KEY); + $cookies.remove('IsAuthenticated'); callback(true); } else if (response.status == APIUtils.API_RESPONSE.ERROR_STATUS) { callback(false); |