|
|
|
@ -12,12 +12,15 @@ const UserService = ($cookies, $rootScope, $location) => { |
|
|
|
|
|
|
|
//load user has been called (is called on page load in menu controller and after login on modal controller)
|
|
|
|
serv.loadUser = () => { |
|
|
|
if(typeof $cookies.get('access_token') !== 'undefined' ){ |
|
|
|
if(typeof $cookies.get('access_token') !== 'undefined' || $location.path() === '/signup'){ |
|
|
|
$rootScope.$broadcast('loadUserSuccess', parseJwt( $cookies.get('access_token') )); |
|
|
|
$('#modalLoginForm').modal('hide'); |
|
|
|
} else if($location.path() === '/signup') { $('#modalLoginForm').modal('hide'); } |
|
|
|
else { $('#modalLoginForm').modal({backdrop: 'static', keyboard: false}); } |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
$('#modalLoginForm').modal({ backdrop: 'static', keyboard: false }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return serv; |
|
|
|
|
|
|
|
|