summaryrefslogtreecommitdiff
path: root/src/lib/auth/hooks/useRegister.js
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-05-08 16:44:09 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-05-08 16:44:09 +0700
commit486f85a45fc7e0669576f59824a31be472ed25bb (patch)
tree0268afa8efe48746e040611ba41ad2cafda7ad08 /src/lib/auth/hooks/useRegister.js
parentcff198277e14450f8d20d9e18548325e6f277682 (diff)
parent30fc50600009ca54f085d594d838803c107e87f2 (diff)
Merge branch 'master' into development_tri/implementasi_raja_ongkir
# Conflicts: # src/lib/checkout/components/Checkout.jsx
Diffstat (limited to 'src/lib/auth/hooks/useRegister.js')
-rw-r--r--src/lib/auth/hooks/useRegister.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/auth/hooks/useRegister.js b/src/lib/auth/hooks/useRegister.js
index 4b0b0d60..1a9412f8 100644
--- a/src/lib/auth/hooks/useRegister.js
+++ b/src/lib/auth/hooks/useRegister.js
@@ -33,8 +33,20 @@ const useRegister = () => {
companyNameRef.current.value = ''
}
+ const recaptchaRef = useRef(null)
+
const handleSubmit = async (e) => {
e.preventDefault()
+
+ const recaptchaValue = recaptchaRef.current.getValue()
+ if (!recaptchaValue) {
+ setAlert({
+ children: 'ReCaptcha harus diisi',
+ type: 'info'
+ })
+ return
+ }
+
setAlert(null)
setIsLoading(true)
const { fullname, email, password, companyName } = inputVal()
@@ -75,6 +87,7 @@ const useRegister = () => {
fullnameRef,
emailRef,
passwordRef,
+ recaptchaRef,
tnd,
setTnd
}