Skip to content

Commit

Permalink
Merge pull request #97 from kaitlinnewson/recaptcha
Browse files Browse the repository at this point in the history
fix recaptcha for login and register
  • Loading branch information
asmecher authored Aug 8, 2024
2 parents 8eaac62 + 6a595a7 commit f658a54
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
16 changes: 14 additions & 2 deletions templates/frontend/pages/userLogin.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{**
* templates/frontend/pages/userLogin.tpl
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Copyright (c) 2014-2024 Simon Fraser University
* Copyright (c) 2003-2024 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* User login form.
Expand Down Expand Up @@ -67,6 +67,18 @@
</div>
</div>

{* recaptcha spam blocker *}
{if $recaptchaPublicKey}
<fieldset class="recaptcha_wrapper">
<div class="fields">
<div class="recaptcha">
<div class="g-recaptcha" data-sitekey="{$recaptchaPublicKey|escape}">
</div><label for="g-recaptcha-response" style="display:none;" hidden>Recaptcha response</label>
</div>
</div>
</fieldset>
{/if}

<div class="form-group">
<button class="btn btn-primary" type="submit">
{translate key="user.login"}
Expand Down
9 changes: 5 additions & 4 deletions templates/frontend/pages/userRegister.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{**
* templates/frontend/pages/userRegister.tpl
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Copyright (c) 2014-2024 Simon Fraser University
* Copyright (c) 2003-2024 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* User registration form.
Expand Down Expand Up @@ -109,11 +109,12 @@
{include file="frontend/components/registrationFormContexts.tpl"}

{* recaptcha spam blocker *}
{if $reCaptchaHtml}
{if $recaptchaPublicKey}
<fieldset class="recaptcha_wrapper">
<div class="fields">
<div class="recaptcha">
{$reCaptchaHtml}
<div class="g-recaptcha" data-sitekey="{$recaptchaPublicKey|escape}">
</div><label for="g-recaptcha-response" style="display:none;" hidden>Recaptcha response</label>
</div>
</div>
</fieldset>
Expand Down

0 comments on commit f658a54

Please sign in to comment.