3

Very recently invisible Captcha is released by google. https://www.google.com/recaptcha/intro/invisible.html

Is there a way to integrate this system with help of AngularJS?

Clarification This question is not about regular reCaptcha from Google. I am asking about Invisible reCaptcha. Here is the detailed situation.

My registration form is already using AngularJS. The form submission is triggered by AngularJS standards. The invisible reCaptcha requires me to give callback function for form submission. Which is confusing part.

8
  • The google Captcha system uses their script to process the captcha then tell your script it is successful. What would you need AngularJS to "help" with? Commented Mar 20, 2017 at 0:26
  • Possible duplicate of Recaptcha in Angular JS Commented Mar 20, 2017 at 0:26
  • @DanielBernsons there is a difference between reCaptcha and invisible reCaptcha from google. Commented Mar 20, 2017 at 0:36
  • @Claies My registration form is already using AngularJS. The form submission is triggered by AngularJS standards. The invisible reCaptcha requires me to give callback function for form submission. Which is confusing part. Commented Mar 20, 2017 at 0:38
  • what does "the form is triggered by AngularJS standards" mean? AngularJS is just JavaScript, and so is the invisible reCaptcha. there isn't anything in AngularJS that would stop the processing of the captcha. The callback is simply the function that you would normally trigger after the captcha is successful; most likely, that's what you were triggering on ng-click. Commented Mar 20, 2017 at 1:08

1 Answer 1

2

You cannot reference directly the angularJs function inside the invisible reCAPTCHA data-callback, it expects a global function, so the solution i came up with is :

$scope.login = function (token) {
  // your login logic
}
$window.login = $scope.login;

then you can use data-callback="login" inside your login button.

hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

is this considered safe? @chtiwi
@HemenAshodia, yes but you have to send the token to the server, then the server should post that token to google and get a confirmation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.