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 @@
  • New
  • Stream
  • Notifications
  • -
  • Logout
  • +
  • Logout
  • {% endif %} diff --git a/templates/login.html b/templates/login.html index 603808c..fde73d2 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,11 +1,20 @@ {% extends "layout.html" %} {% import 'utils.html' as utils %} {% block title %}Login - {{ config.NAME }}{% endblock %} -{% block header %} +{% block headers %} + {% endblock %} {% block content %} -
    - {% if session.logged_in %}logged{% else%}not logged{%endif%} +