dozoisch / dozoisch/react-google-recaptcha

react-google-recaptcha doesn't work when not accessing webpack-dev-server from localhost

Open
#167 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.1k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

react-google-recaptcha version: `2.0.1`

I'm using `webpack-dev-server` where I'm setting the `host` key to `0.0.0.0` so that I can access my dev-server from other devices on the same wifi.

This means when I run my application it's exposed on `http://0.0.0.0:8000`. Here the reCAPTCHA doesn't work. No errors get thrown but I can't log in because the `reCaptchaToken` will forever be `null`. It also doesn't show the reCAPTCHA itself.

The same issue occurs when I try to login on any other machine which is on the same wifi as the machine where my dev server is running on. The only way when the reCAPTCHA does work is when I access my application from `http://localhost:8000`.

Is this a wrongly configured Webpack configuration or a bug? If you need any more information please let me know.

Webpack dev server configuration:

```js
devServer: {
compress: true,
contentBase: distPath,
disableHostCheck: true,
historyApiFallback: true,
host: '0.0.0.0',
hot: true,
open: true,
port: 8000,
publicPath: '/',
},
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.