Skip to content

Commit

Permalink
Merge pull request #2508 from sul-dlss/recaptcha-placeholder
Browse files Browse the repository at this point in the history
Empty recaptcha placeholder before turbolinks cache
  • Loading branch information
jcoyne authored Aug 12, 2024
2 parents 1e6f2cc + 81327d8 commit 7b969f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/views/spotlight/shared/_report_a_problem.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
<%= f.hidden_field :current_url %>
<%= recaptcha_v3(action: 'feedback', inline_script: false) %>
<script type="text/javascript">
document.addEventListener('turbolinks:before-cache', function() {
document.querySelector('.g-recaptcha').innerHTML = '';
});
document.forms.new_contact_form.addEventListener('submit', async function(e) {
e.preventDefault();
const response = await grecaptcha.execute("<%= Recaptcha.configuration.site_key %>", { action: 'feedback' });
Expand Down

0 comments on commit 7b969f3

Please sign in to comment.