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,
closeByEscape: $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 () {
$http.post('/users/logout/').then(function (response) {
operator.setUser(null);
// TODO: remove all data from cache and reload page
// DS.flush();
window.location.reload();
});
};
}
@ -912,6 +907,9 @@ angular.module('OpenSlidesApp.users.site', ['OpenSlidesApp.users'])
// Success: User logged in.
operator.setUser(response.data.user_id);
$scope.closeThisDialog();
setTimeout(function(){
window.location.replace('/');
}, 1000);
},
function (response) {
// Error: Username or password is not correct.