diff --git a/_includes/scripts.html b/_includes/scripts.html
index 90b047fc749f3f0886c47934856a71272944f862..5530028ef866c61947c18d716b10859604f3d4b9 100644
--- a/_includes/scripts.html
+++ b/_includes/scripts.html
@@ -37,15 +37,3 @@
     <script src="{{ script_path }}"></script>
   {% endfor %}
 {% endif %}
-
-<script>
-  if (window.netlifyIdentity) {
-    window.netlifyIdentity.on("init", user => {
-      if (!user) {
-        window.netlifyIdentity.on("login", () => {
-          document.location.href = "/lepuget/";
-        });
-      }
-    });
-  }
-</script>
diff --git a/_layouts/default.html b/_layouts/default.html
index 34c4e3f7c98f2cb4507181923b982b035b563578..6f019c9229c76f81720fb25d0d8a3a4b0ab4d000 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -12,6 +12,18 @@
   <head>
     {% include head.html %}
     {% include head/custom.html %}
+
+    <script>
+    if (window.netlifyIdentity) {
+        window.netlifyIdentity.on("init", user => {
+        if (!user) {
+            window.netlifyIdentity.on("login", () => {
+            document.location.href = "/lepuget/";
+            });
+        }
+        });
+    }
+    </script>
   </head>
 
   <body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}">