From fc3f6c540354371e9eb1eb16fc98ad007fd824f3 Mon Sep 17 00:00:00 2001 From: aj Date: Mon, 14 Aug 2017 19:35:53 +0000 Subject: [PATCH] merge with master --- js/services/auth.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/services/auth.js b/js/services/auth.js index f6cbb5f..16afea1 100644 --- a/js/services/auth.js +++ b/js/services/auth.js @@ -1,6 +1,9 @@ -app.factory('Auth', ['localStorageService', '$location', '$rootScope', function(localStorageService, $location, $rootScope) { +app.factory('Auth', [ + '$rootScope', 'localStorageService', '$location', 'azp@oauth3.org' +, function($rootScope, localStorageService, $location, Oauth3) { var user; - return{ + + return { setUser: function(currentUser){ user = currentUser; if (redirectedURL === '/splash-page') { @@ -8,8 +11,10 @@ app.factory('Auth', ['localStorageService', '$location', '$rootScope', function( } else { $location.path('/' + redirectedURL); } + user = localStorageService.set('userAuth', JSON.stringify(currentUser)); }, isLoggedIn: function(){ + // TODO check sessions instead user = JSON.parse(localStorageService.get('userAuth')); return (user) ? user : false; },