John
John

Reputation: 121

How to add captcha in React JS besides google recaptcha v2

I am using reactjs & mvc web api 2 to build my website. and I want to add captcha in my UI form.

Is there any other way to add captcha in reactJS / Web Api 2 beside using google recaptcha.

It seems everybody are using recaptcha v2. but in my case, I prefer use text based captcha, like recaptcha v1.

Thanks

Upvotes: 3

Views: 2300

Answers (1)

user2923339
user2923339

Reputation: 159

You don't have to rely on the Google's solution to this problem. If you're using React you can simply create your own component named Captcha which will decide if the form can be passed. How to do that?

  1. Create new React Component Captcha and place it wherever you want in your app. You can generate 2 random Integers and ask the user to add them.
  2. According to the above create a verification method. Just check if the result given is equal to what it should be. Place the verification on the server side of your application, since browser side can be manipulated.
  3. Only pass the form when the verification has passed.
  4. Set some delay if your user fails the verification. Can be small- remember it is to prevent bots from spaming you.

As simple as that! Your imagination is the limit. Inside of that React Component you can define whatever method of verification you'd like to. Can be simple math task, can be distinguishing the shapes, colors, whatever you want...

Upvotes: 1

Related Questions