From 6f456fc5ce7fa9c118f58bb6ee3f71df217514b7 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Fri, 23 Sep 2022 19:12:07 +0000 Subject: [PATCH] Some login/logout fixes --- undercover/routes.py | 4 ++-- undercover/templates/writing.jinja2 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/undercover/routes.py b/undercover/routes.py index 7b3713d..d32801e 100644 --- a/undercover/routes.py +++ b/undercover/routes.py @@ -80,7 +80,7 @@ def login(): ''' -@writing_blueprint.route('/logout', methods=['POST']) +@writing_blueprint.route('/logout', methods=['POST', 'GET']) def logout(): session.pop('username', None) return redirect('/') @@ -91,7 +91,7 @@ def index_get(): return render_template( 'writing.jinja2', form=CLForm(), - username=session['username'] + username=session.get('username') ) diff --git a/undercover/templates/writing.jinja2 b/undercover/templates/writing.jinja2 index 342b6eb..f8204e0 100644 --- a/undercover/templates/writing.jinja2 +++ b/undercover/templates/writing.jinja2 @@ -51,14 +51,14 @@ {% else %}

You are here as a guest.

-
+ - +
{% endif %}