diff --git a/app.py b/app.py index 91003bc..d289858 100644 --- a/app.py +++ b/app.py @@ -471,6 +471,9 @@ def admin_logout(): @app.route("/login", methods=["POST", "GET"]) def admin_login(): + if session.get("logged_in") is True: + return redirect(url_for("admin_notifications")) + devices = [doc["device"] for doc in DB.u2f.find()] u2f_enabled = True if devices else False if request.method == "POST": diff --git a/templates/layout.html b/templates/layout.html index 21522fa..5956de5 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -12,6 +12,7 @@ {% block links %}{% endblock %} {% if config.THEME_COLOR %}{% endif %} +{% block headers %}{% endblock %}
{% if logged_in %} @@ -20,7 +21,7 @@