fixed signout glitching bug

This commit is contained in:
David Baldwynn 2017-11-15 04:10:15 -08:00
parent a193d78d90
commit 6c41e6fce2
2 changed files with 2 additions and 6 deletions

View File

@ -39,12 +39,8 @@ angular.module('core').controller('HeaderController', ['$rootScope', '$scope', '
var promise = User.logout();
promise.then(function() {
Auth.logout();
Auth.ensureHasCurrentUser(User);
$scope.user = $rootScope.user = null;
$state.go('listForms');
//Refresh view
$state.reload();
$state.go('signin', { reload: true });
},
function(reason) {
console.error('Logout Failed: ' + reason);

View File

@ -17,7 +17,7 @@ angular.module('users').controller('AuthenticationController', ['$scope', '$loca
Auth.login(response);
$scope.user = $rootScope.user = Auth.ensureHasCurrentUser(User);
if(statesToIgnore.indexOf($state.previous.state.name) === -1) {
if($state.previous && statesToIgnore.indexOf($state.previous.state.name) === -1) {
$state.go($state.previous.state.name, $state.previous.params);
} else {
$state.go('listForms');