Bring back an optional reCAPTCHA v2

Only showing it in the recovery view, not yet validating the result.

Signed-off-by: Peter Marheine <peter@taricorp.net>
This commit is contained in:
Peter Marheine
2018-08-11 21:05:07 +10:00
parent a928b9ee3f
commit 1b833003fb
2 changed files with 11 additions and 0 deletions
@@ -69,6 +69,10 @@ public class RecoverController {
}
}
if (settingsService.isCaptchaEnabled()) {
map.put("recaptchaSiteKey", settingsService.getRecaptchaSiteKey());
}
return new ModelAndView("recover", "model", map);
}
@@ -21,6 +21,13 @@
<input name="submit" type="submit" value="<fmt:message key="recover.send"/>">
</c:if>
<c:if test="${not empty model.recaptchaSiteKey and empty model.sentTo}">
<p style="padding-top: 1em">
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<div class="g-recaptcha" data-sitekey="${model.recaptchaSiteKey}"></div>
</p>
</c:if>
<c:if test="${not empty model.sentTo}">
<p style="padding-top: 1em"><fmt:message key="recover.success"><fmt:param value="${model.sentTo}"/></fmt:message></p>
</c:if>