diff --git a/shopping_app/routes_main.py b/shopping_app/routes_main.py index 859ed83..3218de1 100644 --- a/shopping_app/routes_main.py +++ b/shopping_app/routes_main.py @@ -207,11 +207,9 @@ def main_page(): @app.route("/system-auth", methods=["GET", "POST"]) def system_auth(): - if ( - current_user.is_authenticated - or request.cookies.get("authorized") == AUTHORIZED_COOKIE_VALUE - ): - flash("Jesteś już zalogowany lub autoryzowany.", "info") + + if request.cookies.get("authorized") == AUTHORIZED_COOKIE_VALUE: + flash("Jesteś już autoryzowany.", "info") return redirect(url_for("main_page")) ip = request.access_route[0] diff --git a/shopping_app/templates/base.html b/shopping_app/templates/base.html index 9585856..1d40de3 100644 --- a/shopping_app/templates/base.html +++ b/shopping_app/templates/base.html @@ -12,6 +12,8 @@ + {% set hide_login_ui = request.path == '/system-auth' %} + {% set exclude_paths = ['/system-auth'] %} {% if (exclude_paths | select("in", request.path) | list | length == 0) and has_authorized_cookie @@ -82,7 +84,7 @@