From 20d0f97ffbe5fd2506ffb05b1e0a96a6b23444f6 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 8 Jun 2018 11:48:11 -0400 Subject: [PATCH] Logout button --- app.py | 7 +++++++ templates/dashboard.html | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 89f3826..fb41760 100644 --- a/app.py +++ b/app.py @@ -220,6 +220,13 @@ def admin_login(): return redirect("/admin") +@app.route("/logout") +def admin_logout(): + session.clear() + flash("Logged out", "info") + return redirect("/") + + @app.route("/dashboard") def admin_dashboard(): if "username" in session: diff --git a/templates/dashboard.html b/templates/dashboard.html index d5bd32e..bde547c 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -6,7 +6,7 @@
Dashboard
- todo + Logout