From f0dc2acb76d6d9e5a327ce2fe72c3c4df5d0508c Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Fri, 27 Mar 2015 19:29:20 -0400 Subject: add a logout link --- templates/layout.html | 1 + wedding.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/templates/layout.html b/templates/layout.html index 81c136d..f8ac3b9 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -21,6 +21,7 @@ +
diff --git a/wedding.py b/wedding.py index bb3df7a..14134c2 100644 --- a/wedding.py +++ b/wedding.py @@ -96,6 +96,11 @@ def rsvp(): def main_page(): return render_template("main.html") +@app.route('/logout') +def logout(): + session.clear() + return redirect(url_for('login')) + @app.route('/login/', methods=['GET', 'POST']) def login(): if 'user_name' in session: -- cgit v1.2.3-70-g09d2