From c9b7bed94b3e9913e56ae3629c742bd36ee6a287 Mon Sep 17 00:00:00 2001
From: LpCote <73721863+LpCote4@users.noreply.github.com>
Date: Thu, 7 Nov 2024 20:01:19 -0500
Subject: [PATCH] fix: default route to scoreboard and pages after Classement
 et defis

---
 .../core-beta/templates/components/navbar.html   | 16 ++++++++--------
 CTFd/views.py                                    |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/CTFd/themes/core-beta/templates/components/navbar.html b/CTFd/themes/core-beta/templates/components/navbar.html
index abf806cc..d8f1e6cd 100644
--- a/CTFd/themes/core-beta/templates/components/navbar.html
+++ b/CTFd/themes/core-beta/templates/components/navbar.html
@@ -30,14 +30,6 @@
 
     <div class="collapse navbar-collapse" id="base-navbars">
       <ul class="navbar-nav me-auto">
-        {% for page in Plugins.user_menu_pages %}
-          <li class="nav-item">
-            <a class="nav-link" href="{{ page.route }}" {% if page.link_target %}target="{{ page.link_target }}"{% endif %}>
-              {{ page.title }}
-            </a>
-          </li>
-          
-        {% endfor %}
         <li class="nav-item">
           <a class="nav-link" href="/scoreboard">
             Classement
@@ -48,6 +40,14 @@
             {% trans %}Défis{% endtrans %}
           </a>
         </li>
+        {% for page in Plugins.user_menu_pages %}
+        <li class="nav-item">
+          <a class="nav-link" href="{{ page.route }}" {% if page.link_target %}target="{{ page.link_target }}"{% endif %}>
+            {{ page.title }}
+          </a>
+        </li>
+        
+        {% endfor %}
         {% if Configs.account_visibility != 'public' %}
           <li class="nav-item">
             <a class="nav-link" href="{{ url_for('users.listing') }}">
diff --git a/CTFd/views.py b/CTFd/views.py
index c921a2ed..a311c032 100644
--- a/CTFd/views.py
+++ b/CTFd/views.py
@@ -402,7 +402,7 @@ def settings():
     )
 
 
-@views.route("/", defaults={"route": "index"})
+@views.route("/", defaults={"route": "none"})
 @views.route("/<path:route>")
 def static_html(route):
     """
@@ -412,7 +412,7 @@ def static_html(route):
     """
     page = get_page(route)
     if page is None:
-        return redirect(url_for("scoreboard.listing", next=request.full_path))
+        return redirect(url_for("scoreboard.listing"))
     else:
         if page.auth_required and authed() is False:
             return redirect(url_for("auth.login", next=request.full_path))
-- 
GitLab