According to the Google’s developer guide, localhost domains are not supported by default due to which you will get the following error on captcha:
“Localhost is not in the list of supported domains”
In order to access captcha on your localhost, you need to add them to the list of supported domains for your site key.
Follow the steps below to remove the above mentioned error:
- Go to the reCAPTCHA Enterprise console or to the reCAPTCHA console.
- Click on the Settings icon (⚙️).
- Scroll down to domains section.
- In the Add a domain input section, add localhost and press enter. (localhost:4200, 127.0.0.1:4200 and http://localhost:4200 all are invalid formats, only use localhost)
- Click SAVE.
Optional: if you are using 127.0.0.1 instead of localhost, add 127.0.0.1 too.
Once you refresh your webpage, you will be able to access captcha on localhost. You can now use it to develop and test your web application.
It is recommended to use separate keys for development and production, where you can use development site key on your local.
Follow us on Instagram
Top comments (1)
Thank you for the helpful information