summary refs log tree commit diff
path: root/webclient/login
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-05 23:32:07 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-05 23:32:07 -0700
commita342867d3f86096d53a59b0e09d6ac6121bfaa6f (patch)
tree9228c774ef30e96cf4cfb97dcc66168bff92d8f7 /webclient/login
parentReload captchas when they fail. Cleanup on success. (diff)
downloadsynapse-a342867d3f86096d53a59b0e09d6ac6121bfaa6f.tar.xz
Added instructions for setting up captcha in an obviously named file.
Diffstat (limited to 'webclient/login')
-rw-r--r--webclient/login/register-controller.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/webclient/login/register-controller.js b/webclient/login/register-controller.js
index 1ab50888df..b3c0c21335 100644
--- a/webclient/login/register-controller.js
+++ b/webclient/login/register-controller.js
@@ -19,7 +19,11 @@ angular.module('RegisterController', ['matrixService'])
                                     function($scope, $rootScope, $location, matrixService, eventStreamService) {
     'use strict';
     
+    var config = window.webClientConfig;
     var useCaptcha = true;
+    if (config !== undefined) {
+        useCaptcha = config.useCaptcha;
+    }
     
     // FIXME: factor out duplication with login-controller.js
     
@@ -132,6 +136,10 @@ angular.module('RegisterController', ['matrixService'])
                     else if (error.data.errcode == "M_CAPTCHA_INVALID") {
                         $scope.feedback = "Failed captcha.";
                     }
+                    else if (error.data.errcode == "M_CAPTCHA_NEEDED") {
+                        $scope.feedback = "Captcha is required on this home " +
+                                          "server.";
+                    }
                 }
                 else if (error.status === 0) {
                     $scope.feedback = "Unable to talk to the server.";