diff --git a/isso/css/admin.css b/isso/css/admin.css index 3f694c34..7df6f8b9 100644 --- a/isso/css/admin.css +++ b/isso/css/admin.css @@ -51,6 +51,9 @@ input { color: #4d4c4c; text-decoration: none; } +.header .logout { + float: right; +} .outer { background-color: #eeeeee; box-shadow: 0 0 0.5em #c0c0c0 inset; diff --git a/isso/templates/admin.html b/isso/templates/admin.html index 11d6feb1..a13e87b5 100644 --- a/isso/templates/admin.html +++ b/isso/templates/admin.html @@ -17,6 +17,7 @@

Administration

+ Log Out
diff --git a/isso/views/comments.py b/isso/views/comments.py index 67021175..2bf108f3 100644 --- a/isso/views/comments.py +++ b/isso/views/comments.py @@ -110,6 +110,7 @@ class API(object): ('preview', ('POST', '/preview')), ('config', ('GET', '/config')), ('login', ('POST', '/login/')), + ('logout', ('GET', '/logout')), ('admin', ('GET', '/admin/')) ] @@ -1353,6 +1354,12 @@ 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