Reload after login and logout (Fixes #1820)

Not very nice solution but with DS.clear() we have to do a lot of more
work with high effort. Can improved later.
This commit is contained in:
Emanuel Schuetze 2016-02-17 17:47:22 +01:00
parent 88b2e8a73e
commit 06f7515ca4

View File

@ -129,10 +129,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;
}
}); });
}] }]
}); });
@ -870,8 +866,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();
}); });
}; };
} }
@ -912,6 +907,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.