Skip to content

Commit

Permalink
Merge pull request #116 from kaitlinnewson/recaptcha
Browse files Browse the repository at this point in the history
fix recaptcha on login and registration
  • Loading branch information
asmecher authored Aug 8, 2024
2 parents 316b47d + 2b79285 commit 1e907b7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
18 changes: 16 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 @@ -68,6 +68,20 @@
<label class="custom-control-label" for="remember">{translate key="user.login.rememberUsernameAndPassword"}</label>
</div>

{* recaptcha spam blocker *}
{if $recaptchaPublicKey}
<div class="col-md-6 offset-md-3">
<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>
</div>
{/if}

<div class="col-md-6 offset-md-3 buttons">
<button class="submit 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.
*
* @brief User registration form.
Expand Down Expand Up @@ -136,11 +136,12 @@
{/if}

{* 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 1e907b7

Please sign in to comment.