summaryrefslogtreecommitdiff
path: root/src/lib/auth/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/auth/hooks')
-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
}