From e786f2ee756dbcbc74e73d0985fb732f42f16f1f Mon Sep 17 00:00:00 2001 From: robertu <4065233+robertu7@users.noreply.github.com> Date: Tue, 17 Oct 2023 08:17:51 +0700 Subject: [PATCH] fix(recaptcha): enable recaptcha for wallet login --- .../Forms/Verification/SendCodeButton/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Forms/Verification/SendCodeButton/index.tsx b/src/components/Forms/Verification/SendCodeButton/index.tsx index 47e094bd36..f3ff32df9e 100644 --- a/src/components/Forms/Verification/SendCodeButton/index.tsx +++ b/src/components/Forms/Verification/SendCodeButton/index.tsx @@ -1,9 +1,9 @@ -import { useState } from 'react' +import { useContext, useState } from 'react' import { SEND_CODE_COUNTDOWN, VERIFICATION_CODE_TYPES } from '~/common/enums' import { Button, - // ReCaptchaContext, + ReCaptchaContext, TextIcon, Translate, useLegacyCountdown, @@ -36,7 +36,7 @@ interface VerificationSendCodeButtonProps { export const VerificationSendCodeButton: React.FC< VerificationSendCodeButtonProps > = ({ email, type, disabled }) => { - // const { token, refreshToken } = useContext(ReCaptchaContext) + const { token, refreshToken } = useContext(ReCaptchaContext) const [send] = useMutation(SEND_CODE) const [sent, setSent] = useState(false) @@ -48,15 +48,15 @@ export const VerificationSendCodeButton: React.FC< const sendCode = async () => { // reCaptcha check is disabled for now await send({ - variables: { input: { email, type, token: '' } }, + variables: { input: { email, type, token } }, }) setCountdown({ timeLeft: SEND_CODE_COUNTDOWN }) setSent(true) - // if (refreshToken) { - // refreshToken() - // } + if (refreshToken) { + refreshToken() + } } return (