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>
master
Peter Marheine 6 years ago
parent a928b9ee3f
commit 1b833003fb
  1. 4
      airsonic-main/src/main/java/org/airsonic/player/controller/RecoverController.java
  2. 7
      airsonic-main/src/main/webapp/WEB-INF/jsp/recover.jsp

@ -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>

Loading…
Cancel
Save