Open supsup opened 5 years ago
I had to read that FAQ entry a couple of times before I realized that "globally" meant "worldwide" in this case.
I'm not sure that a property is the way I'd like to go with this. There are only two possibilities for the domain right now (www.google.com
and www.recaptcha.net
), so maybe just a config flag to indicate when not to use the default value?
My concern with a config property is that anything could be injected as the base domain, and it opens up the possibility of users not knowing the correct alternate domain or entering it incorrectly.
Flag works
Currently in src/main/groovy/com/megatome/grails/recaptcha/ReCaptcha.groovy line 26 BASE_URL is set to:
private static final String BASE_URL = "https://www.google.com/recaptcha/api"
https://developers.google.com/recaptcha/docs/faq
Can I use reCAPTCHA globally?
Request Enhancement: Make root DOMAIN a property. i.e., line 26 BASE_URL becomes: https://www.google.com becomes something like:
private static final String BASE_DOMAIN = "${grailsApplication.config.getProperty('reCaptcha.domain') ?: 'https://www.google.com'}"
private static final String BASE_URL = "${BASE_DOMAIN}/recaptcha/api"