Skip to content

Commit afc03f0

Browse files
authored
Refactor: web perf - load recaptcha script only where it's needed (#2631)
2 parents 82b4b67 + 26ccf3c commit afc03f0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

benefits/core/templates/core/base.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,5 @@
161161
});
162162
});
163163
</script>
164-
165-
{% if request.recaptcha %}
166-
<script nonce="{{ request.csp_nonce }}" src="{{ request.recaptcha.script_api }}"></script>
167-
{% endif %}
168164
</body>
169165
</html>

benefits/core/templates/core/includes/form.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
</script>
8080

8181
{% if request.recaptcha %}
82+
<script nonce="{{ request.csp_nonce }}" src="{{ request.recaptcha.script_api }}"></script>
83+
8284
{% comment %}
8385
Adapted from https://stackoverflow.com/a/63290578/453168
8486
{% endcomment %}

0 commit comments

Comments
 (0)