diff --git a/isso/js/admin.js b/isso/js/admin.js index 5b1e5086..96217e0f 100644 --- a/isso/js/admin.js +++ b/isso/js/admin.js @@ -124,4 +124,8 @@ function send_edit(com_id, hash, isso_host_script) { edit(com_id, hash, author, email, website, comment, isso_host_script); stop_edit(com_id, true); } - +function log_out() { + // Delete cookie + document.cookie = "admin-session=; Max-Age=0; domain=" + window.location.hostname + "; path=/"; + window.location.reload(); +} diff --git a/isso/templates/admin.html b/isso/templates/admin.html index 6a862d6a..625057a9 100644 --- a/isso/templates/admin.html +++ b/isso/templates/admin.html @@ -18,7 +18,7 @@

Administration

- Log Out + Log Out
diff --git a/isso/views/comments.py b/isso/views/comments.py index 69058c0f..3fd2d342 100644 --- a/isso/views/comments.py +++ b/isso/views/comments.py @@ -110,7 +110,6 @@ class API(object): ('preview', ('POST', '/preview')), ('config', ('GET', '/config')), ('login', ('POST', '/login/')), - ('logout', ('GET', '/logout')), ('admin', ('GET', '/admin/')) ] @@ -1354,12 +1353,6 @@ def login(self, env, req): isso_host_script = self.isso.conf.get("server", "public-endpoint") or local.host return render_template('login.html', isso_host_script=isso_host_script) - def logout(self, env, req): - response = redirect("/admin") - response.headers.add("Set-Cookie", "admin-session=none; path=/; max-age=0;") - response.headers.add("X-Set-Cookie", "isso-admin-session=none; path=/; max-age=0;") - return response - """ @api {get} /admin/ Admin interface @apiGroup Admin