debug for logged in user

This commit is contained in:
Davide Alberani 2016-07-08 21:29:09 +02:00
parent 2ac2b09bee
commit 6aa219f265
2 changed files with 4 additions and 2 deletions

View file

@ -43,7 +43,7 @@ eventManApp.run(['$rootScope', '$state', '$stateParams', '$log', 'Info',
Info.get({}, function(data) {
$rootScope.info = data || {};
if (callback) {
callback();
callback(data);
}
});
};

View file

@ -668,7 +668,8 @@ eventManControllers.controller('LoginCtrl', ['$scope', '$rootScope', '$state', '
}
User.login(loginData, function(data) {
if (!data.error) {
$rootScope.readInfo(function() {
$rootScope.readInfo(function(info) {
$log.debug('logged in user: ' + info.user.username);
$rootScope.clearError();
$state.go('events');
});
@ -680,6 +681,7 @@ eventManControllers.controller('LoginCtrl', ['$scope', '$rootScope', '$state', '
User.logout({}, function(data) {
if (!data.error) {
$rootScope.readInfo(function() {
$log.debug('logged out user');
$state.go('events');
});
}