Created
September 28, 2014 04:12
-
-
Save JosephShering/fc0c7265c2b32ab83d5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.controller('CMSController', function($scope, $state, $rootScope, AuthToken) { | |
$scope.$on('$stateChangeStart', function(e, toState, toParams, fromState) { | |
var token = AuthToken.get(); | |
if(toState != 'admin.login' && !token) { | |
$state.go('admin.login'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment