summary refs log tree commit diff
path: root/static/client/register/js/register.js
blob: b8a9247e6d0c2c9da5233e72bb7f50a39a3bbb53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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();
};