merge with master

This commit is contained in:
aj 2017-08-14 19:35:53 +00:00
parent b41f0624b8
commit fc3f6c5403
1 changed files with 7 additions and 2 deletions

View File

@ -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; var user;
return{
return {
setUser: function(currentUser){ setUser: function(currentUser){
user = currentUser; user = currentUser;
if (redirectedURL === '/splash-page') { if (redirectedURL === '/splash-page') {
@ -8,8 +11,10 @@ app.factory('Auth', ['localStorageService', '$location', '$rootScope', function(
} else { } else {
$location.path('/' + redirectedURL); $location.path('/' + redirectedURL);
} }
user = localStorageService.set('userAuth', JSON.stringify(currentUser));
}, },
isLoggedIn: function(){ isLoggedIn: function(){
// TODO check sessions instead
user = JSON.parse(localStorageService.get('userAuth')); user = JSON.parse(localStorageService.get('userAuth'));
return (user) ? user : false; return (user) ? user : false;
}, },