Recaptcha #886

Closed
liamcardenas wants to merge 5 commits from recaptcha into master
3 changed files with 9 additions and 5 deletions
Showing only changes of commit 8ca3617fbd - Show all commits

View file

@ -2,8 +2,12 @@ import React from "react";
import Link from "component/link";
import { CreditAmount } from "component/common";
import { Form, FormRow, Submit } from "component/form.js";
import Recaptcha from "react-recaptcha";
var Recaptcha = require("react-recaptcha");
const sitekey =
process.env.NODE_ENV === "development"
? "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"
: "6LcWvj0UAAAAAGBAEp6-UDoe0_iSAn8IZW0GDcf0";
class UserEmailVerify extends React.PureComponent {
constructor(props) {
@ -28,7 +32,7 @@ class UserEmailVerify extends React.PureComponent {
verifyCallback(response) {
this.setState({
recaptcha: String(response).trim(),
recaptcha: String(response),
});
}
@ -54,7 +58,7 @@ class UserEmailVerify extends React.PureComponent {
errorMessage={errorMessage}
/>
<Recaptcha
sitekey="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"
sitekey={sitekey}
verifyCallback={this.verifyCallback.bind(this)}
/>
{/* render help separately so it always shows */}

View file

@ -19,7 +19,7 @@ const contextMenu = remote.require("./main.js").contextMenu;
const app = require("./app");
const load = require("@segment/load-script");
load("//www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit");
load("//www.google.com/recaptcha/api.js?render=explicit");
// Workaround for https://github.com/electron-userland/electron-webpack/issues/52
if (process.env.NODE_ENV !== "development") {

View file

@ -105,7 +105,7 @@ export function doUserEmailVerify(verificationToken, recaptcha) {
return function(dispatch, getState) {
const email = selectEmailToVerify(getState());
verificationToken = verificationToken.toString().trim();
recaptcha = recaptcha.toString().trim();
recaptcha = recaptcha.toString();
dispatch({
type: types.USER_EMAIL_VERIFY_STARTED,