summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérôme Schneider <jschneider@entrouvert.com>2014-09-11 10:34:33 (GMT)
committerJérôme Schneider <jschneider@entrouvert.com>2014-09-11 10:34:33 (GMT)
commit4110ba52a0d0cb153b2ae6f760628742def75ba3 (patch)
tree73015c436f1a734cbf20abe68e1d4d618de0699d
parentf73fd4e29b0656e5815948bd8cf8277c833d244c (diff)
downloadmandaye-cud-4110ba52a0d0cb153b2ae6f760628742def75ba3.zip
mandaye-cud-4110ba52a0d0cb153b2ae6f760628742def75ba3.tar.gz
mandaye-cud-4110ba52a0d0cb153b2ae6f760628742def75ba3.tar.bz2
arcopole: fix local logout on Firefox
Closes #5444
-rw-r--r--mandaye_cud/filters/cud.py10
-rw-r--r--mandaye_cud/mappers/arcopole.py2
-rw-r--r--mandaye_cud/static/js/toolbar.js2
3 files changed, 12 insertions, 2 deletions
diff --git a/mandaye_cud/filters/cud.py b/mandaye_cud/filters/cud.py
index aed0d0a..2502c36 100644
--- a/mandaye_cud/filters/cud.py
+++ b/mandaye_cud/filters/cud.py
@@ -2,6 +2,7 @@
from urlparse import parse_qs
from mandaye.template import serve_template
+from mandaye.response import _302
class ArcopoleFilter:
@@ -23,3 +24,12 @@ class ArcopoleFilter:
return True
return False
+ @staticmethod
+ def local_logout(env, values, request, response):
+ env['beaker.session'].delete()
+ req_cookies = request.cookies
+ for cookie in req_cookies.values():
+ cookie['expires'] = 'Thu, 01 Jan 1970 00:00:01 GMT'
+ cookie['path'] = '/studio'
+ return _302(values['next_url'], req_cookies)
+
diff --git a/mandaye_cud/mappers/arcopole.py b/mandaye_cud/mappers/arcopole.py
index 3c340a9..107be4b 100644
--- a/mandaye_cud/mappers/arcopole.py
+++ b/mandaye_cud/mappers/arcopole.py
@@ -71,7 +71,7 @@ mapping = [
{
'path': r'/studio/locallogout$',
'method': 'GET',
- 'response': {'auth': 'local_logout', 'values': {'next_url': '/studio/accueil'}}
+ 'response': {'filter': ArcopoleFilter.local_logout, 'values': {'next_url': '/studio/accueil'}}
},
{
'path': r'/mandaye/slo$',
diff --git a/mandaye_cud/static/js/toolbar.js b/mandaye_cud/static/js/toolbar.js
index 010b081..e269495 100644
--- a/mandaye_cud/static/js/toolbar.js
+++ b/mandaye_cud/static/js/toolbar.js
@@ -3,7 +3,7 @@ function mandaye_disassociate_logout(url, account, id)
var r = confirm("Etes-vous sûr de vouloir délier le compte " + account + " ?");
if (r == true)
{
- window.location = url + "?id=" + id;
+ window.location.href = url + "?id=" + id;
}
}