IHsojib's avatar

anhskohbo/no-captcha working locally but not working in production

I have used anhskohbo/no-captcha package and its working fine in the local machine. But when deploying the project captcha is showing but I can submit the form without verifying the captcha. I am using AWS EC2 instance server. Site domain is added in reCaptcha, has SSL too but still not validating.

Please someone tell me how to setup it properly...

0 likes
6 replies
Sinnbeck's avatar

Hard to guess with zero info. But did you forget to set the env variables?

NOCAPTCHA_SECRET=foo
NOCAPTCHA_SITEKEY=bar
IHsojib's avatar

@Sinnbeck I have updated the .env NOCAPTCHA_SECRET=dfasdfdsf NOCAPTCHA_SITEKEY=asdfsdfsd

IHsojib's avatar

Problem is fixed.... Issue was I was validating form data and the g captcha in the two separate places. refactored the code validating all data at once now its working. Also I have added out bound rule to AWS EC2 HTTPs TCP 443 0.0.0.0/0

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

@IHsojib Weird that it was working locally with that code. Oh well.

bstory's avatar

How is this package working out for you? I am considering using it for a larger project.

Please or to participate in this conversation.