summary refs log tree commit diff
path: root/webclient/login/register-controller.js
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-05 17:36:09 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-05 17:36:09 -0700
commitc80f7394617dcc44c3a608a3a51acde0f255f623 (patch)
tree104de39e938095f68212470410fc02f4cd40cbb3 /webclient/login/register-controller.js
parentModified matrixService.register to specify if captcha results should be sent ... (diff)
downloadsynapse-c80f7394617dcc44c3a608a3a51acde0f255f623.tar.xz
Added webclient config.js for storing recaptcha public key.
Diffstat (limited to '')
-rw-r--r--webclient/login/register-controller.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/webclient/login/register-controller.js b/webclient/login/register-controller.js
index 9d02f274df..96fffb364d 100644
--- a/webclient/login/register-controller.js
+++ b/webclient/login/register-controller.js
@@ -19,7 +19,7 @@ angular.module('RegisterController', ['matrixService'])
                                     function($scope, $rootScope, $location, matrixService, eventStreamService) {
     'use strict';
     
-    var useCaptcha = false;
+    var useCaptcha = true;
     
     // FIXME: factor out duplication with login-controller.js
     
@@ -147,7 +147,18 @@ angular.module('RegisterController', ['matrixService'])
 	
 	var setupCaptcha = function() {
 	    console.log("Setting up ReCaptcha")
-	    Recaptcha.create("6Le31_kSAAAAAK-54VKccKamtr-MFA_3WS1d_fGV",
+        var config = window.webClientConfig;
+        var public_key = undefined;
+        if (config === undefined) {
+            console.error("Couldn't find webClientConfig. Cannot get public key for captcha.");
+        }
+        else {
+            public_key = webClientConfig.recaptcha_public_key;
+            if (public_key === undefined) {
+                console.error("No public key defined for captcha!")
+            }
+        }
+	    Recaptcha.create(public_key,
 	    "regcaptcha",
 	    {
 	      theme: "red",