Skip to content

Commit

Permalink
added secret keys for recaptcha for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
Oskar Kocjan authored and Oskar Kocjan committed Sep 2, 2022
1 parent e0a524a commit 9e5aa95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export const validateRecaptchaToken = async (
): Promise<boolean> => {
const env = validateEnv();
const response = await axios.post(
`https://www.google.com/recaptcha/api/siteverify?secret=${env.RECAPTCHA_SECRET_KEY}&response=${token}`,
`https://www.google.com/recaptcha/api/siteverify?secret=${
env.RECAPTCHA_SECRET_KEY || process.env.RECAPTCHA_SECRET_KEY
}&response=${token}`,
);

return response.data.success;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ interface SignInFormProps {

const RECAPTCHA_SITE_KEY = window.Cypress
? '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI'
: (process.env.RECAPTCHA_SITE_KEY as string);
: ((process.env.RECAPTCHA_SITE_KEY ||
process.env.REACT_APP_RECAPTCHA_SITE_KEY) as string);

export default function SignInForm({
disabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ interface SignUpFormProps {

const RECAPTCHA_SITE_KEY = window.Cypress
? '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI'
: (process.env.RECAPTCHA_SITE_KEY as string);
: ((process.env.RECAPTCHA_SITE_KEY ||
process.env.REACT_APP_RECAPTCHA_SITE_KEY) as string);

export default function SignUpForm({
disabled,
Expand Down

0 comments on commit 9e5aa95

Please sign in to comment.