Skip to content

Commit

Permalink
Merge pull request #960 from camptocamp/mobile-logout
Browse files Browse the repository at this point in the history
Fix login / logout on mobile
  • Loading branch information
sbrunner committed May 23, 2014
2 parents 0f52902 + 97c58cc commit 6262ed3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,16 @@ Ext.define('App.controller.Main', {
},

logout: function() {
window.location = App.logoutUrl;
Ext.Ajax.request({
url: App.logoutUrl,
success: function(response) {
var sep = App.cameFrom.indexOf('?') > 0 ? '&' : '?';
window.location = App.cameFrom + sep + 'v=' + Math.round(Math.random() * 1000000);
},
failure: function(response, opts) {
Ext.Msg.alert(response.statusText);
}
});
},

recenterMap: function(f) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ Ext.define('App.view.LoginForm', {
listeners: {
exception: function (self, result, eOpts) {
if (result === true) {
window.location = App.cameFrom;
var sep = App.cameFrom.indexOf('?') > 0 ? '&' : '?';
window.location = App.cameFrom + sep + 'v=' + Math.round(Math.random() * 1000000);
}
else {
if (result.status == 401) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
App.wmsUrl = "${request.route_url('mapserverproxy', path='')}";
App.rasterUrl = "${request.route_url('raster', path='')}";
App.loginUrl = "${request.route_url('login', path='')}";
App.logoutUrl = "${request.route_url('logout', path='')}";
App.cameFrom = "${came_from}";
App.logoutUrl = "${request.route_url('logout', _query={'came_from': came_from})}";
App.desktopAppUrl = "${request.route_url('home', path='', _query={'no_redirect':''})}";
</script>
<script type="text/javascript" src="openlayers-mobile.js"></script>
Expand Down

0 comments on commit 6262ed3

Please sign in to comment.