Merge pull request #2003 from emanuelschuetze/fix1820

Reload after login and logout (Fixes #1820)
This commit is contained in:
Emanuel Schütze 2016-02-25 13:51:44 +01:00
commit 2b239f2214

View File

@ -132,10 +132,6 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
showClose: $stateParams.guest_enabled, showClose: $stateParams.guest_enabled,
closeByEscape: $stateParams.guest_enabled, closeByEscape: $stateParams.guest_enabled,
closeByDocument: $stateParams.guest_enabled, closeByDocument: $stateParams.guest_enabled,
preCloseCallback: function() {
$state.go('home');
return true;
}
}); });
}] }]
}); });
@ -884,8 +880,7 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
$scope.logout = function () { $scope.logout = function () {
$http.post('/users/logout/').then(function (response) { $http.post('/users/logout/').then(function (response) {
operator.setUser(null); operator.setUser(null);
// TODO: remove all data from cache and reload page window.location.reload();
// DS.flush();
}); });
}; };
} }
@ -926,6 +921,9 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
// Success: User logged in. // Success: User logged in.
operator.setUser(response.data.user_id); operator.setUser(response.data.user_id);
$scope.closeThisDialog(); $scope.closeThisDialog();
setTimeout(function(){
window.location.replace('/');
}, 1000);
}, },
function (response) { function (response) {
// Error: Username or password is not correct. // Error: Username or password is not correct.