Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Dialogs/LoginDialog/RegisterForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default class RegisterForm extends React.Component {
<ReCaptcha
sitekey={this.props.reCaptchaSiteKey}
onResponse={this.handleCaptchaResponse}
theme="dark"
/>
</FormGroup>
);
Expand Down
14 changes: 10 additions & 4 deletions src/components/ReCaptcha/ReCaptcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@ export default class ReCaptcha extends React.Component {
static propTypes = {
grecaptcha: React.PropTypes.object.isRequired,
sitekey: React.PropTypes.string.isRequired,
theme: React.PropTypes.string,
onResponse: React.PropTypes.func.isRequired
};

static defaultProps = {
theme: 'light'
};

componentDidMount() {
this.props.grecaptcha.render(
this.container,
{ sitekey: this.props.sitekey, callback: this.handleResponse }
);
this.props.grecaptcha.render(this.container, {
sitekey: this.props.sitekey,
callback: this.handleResponse,
theme: this.props.theme
});
}

handleResponse = (res) => {
Expand Down
13 changes: 11 additions & 2 deletions tasks/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ gulp.task('serve', () => {

app
.use(apiUrl, createWebApi(uw, {
recaptcha: false,
recaptcha: {
// Test keys from
// https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha-v2-what-should-i-do
secret: '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe'
},
server,
secret: new Buffer('none', 'utf8')
}))
Expand Down Expand Up @@ -92,7 +96,12 @@ gulp.task('serve', () => {
apiUrl,
emoji: emojione.emoji,
publicPath,
fs
fs,
recaptcha: {
// Test keys from
// https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha-v2-what-should-i-do
key: '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI'
}
}));

uw.on('stopped', () => {
Expand Down