Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user.promise.then(function(){
- wasUserLoaded = true;
- cleanUpDisableNavigationCallback(); // enable navigation
- $rootScope.$on('$stateChangeStart', function(event, toState, toParams) {
- if (!user.current() || !user.current().id && _getInheritedProperty(toState, 'onlyAuthenticated')){
- // restrict access for anonymous users to special pages
- event.preventDefault();
- $state.go('probate.auth.login');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement