Как я могу добавить авторизацию в AngularJS и ui.router? Я использую modulg ng-oauth https://github.com/andreareginato/oauth-ngAngularJS добавление авторизации к маршрутам
Могу ли я использовать следующие примеры со страницы http://andreareginato.github.io/oauth-ng/?
$scope.$on('oauth:login', function(event, token) {
console.log('Authorized third party app with token', token.access_token);
});
$scope.$on('oauth:logout', function(event) {
console.log('The user has signed out');
});
$scope.$on('oauth:loggedOut', function(event) {
console.log('The user is not signed in');
});
$scope.$on('oauth:denied', function(event) {
console.log('The user did not authorize the third party app');
});
$scope.$on('oauth:expired', function(event) {
console.log('The access token is expired. Please refresh.');
});
$scope.$on('oauth:profile', function(profile) {
console.log('User profile data retrieved: ', profile);
});
Спасибо, Simon