diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-05-24 10:53:14 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-05-24 10:53:14 -0400 |
| commit | e5d36a0d6de8155f390747e4281f5507220c37a8 (patch) | |
| tree | 5ce55d2719c20d7c0bc348650c621dbc1ab7ea30 /www/js/DataModel.js | |
| parent | 8b7ca64245eb14c56cd4a64605171b38e4ad383f (diff) | |
#635 promise cleanup
Diffstat (limited to 'www/js/DataModel.js')
| -rwxr-xr-x | www/js/DataModel.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index f2d7dd4f..acdcabc7 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -1594,12 +1594,15 @@ angular.module('zmApp.controllers') }, isReCaptcha: function () { + // always resolves var d = $q.defer(); var myurl = loginData.url; log("Checking if reCaptcha is enabled in ZM..."); + console.log ("Recaptcha: "+myurl); $http.get(myurl) .then(function (success) { + console.log ("Inside recaptcha success"); if (success.data.search("g-recaptcha") != -1) { // recaptcha enable. zmNinja won't work log("ZM has recaptcha enabled", "error"); @@ -1612,6 +1615,13 @@ angular.module('zmApp.controllers') log("ZM has recaptcha disabled - good"); return (d.promise); } + }, + function (err) { + // for whatever reason recaptcha check failed + console.log ("Inside recaptcha fail"); + d.resolve(false); + log("Recaptcha failed, but assuming ZM has recaptcha disabled"); + return (d.promise); }); return (d.promise); }, |
