diff options
Diffstat (limited to 'static/client/register/js/register.js')
-rw-r--r-- | static/client/register/js/register.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/static/client/register/js/register.js b/static/client/register/js/register.js new file mode 100644 index 0000000000..b8a9247e6d --- /dev/null +++ b/static/client/register/js/register.js @@ -0,0 +1,23 @@ +window.matrixRegistration = {}; + +var setupCaptcha = function() { + if (!window.matrixRegistrationConfig) { + return; + } + console.log("Setting up ReCaptcha"); + var public_key = window.matrixRegistrationConfig.recaptcha_public_key; + if (public_key === undefined) { + console.error("No public key defined for captcha!"); + return; + } + Recaptcha.create(public_key, + "regcaptcha", + { + theme: "red", + callback: Recaptcha.focus_response_field + }); +}; + +matrixRegistration.onLoad = function() { + setupCaptcha(); +}; \ No newline at end of file |