app.factory('Auth', ['localStorageService', '$location', function(localStorageService, $location) { var user; return{ setUser: function(currentUser){ user = currentUser; // console.log("%c" + redirectedURL, "color: red; font-size: 72px;"); if (redirectedURL === '/splash-page') { $location.path('/launchpad-home'); } else { $location.path('/launchpad-' + redirectedURL); } }, isLoggedIn: function(){ user = JSON.parse(localStorageService.get('userAuth')); return (user) ? user : false; }, getProfile: function(profile) { profile = user; return profile; } }; }]);