From cd89ee2b8bd2a287029e8205edcb07566796b944 Mon Sep 17 00:00:00 2001 From: pstruebi Date: Tue, 14 Jun 2022 21:48:49 +0200 Subject: [PATCH] Add logout button --- auth.py | 2 +- templates/base.html | 3 +++ templates/index.html | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/auth.py b/auth.py index 9f71aa2..8f11074 100644 --- a/auth.py +++ b/auth.py @@ -101,7 +101,7 @@ def load_logged_in_user(): @bp.route('/logout') def logout(): session.clear() - return redirect(url_for('index')) + return redirect(url_for('auth.login')) def login_required(view): # use this as decorator diff --git a/templates/base.html b/templates/base.html index ff85492..6bdab9f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -21,6 +21,9 @@ + diff --git a/templates/index.html b/templates/index.html index f1bcf42..dab03e9 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block content %} -

{% block title %} Hallo, {{user["username"]}} ({{user["email"]}}) {% endblock %}

+

{% block title %} Hallo, {{user["username"]}} ({{user["email"]}}) {% endblock %}

{% set ns = namespace(last_date='...') %} {% for event in events %}