summaryrefslogtreecommitdiff
path: root/src/lib/form/components/PembayaranTempo.jsx
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2024-01-31 09:03:22 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2024-01-31 09:03:22 +0700
commitb8764138241116e0c741a7786364f5630080720c (patch)
treecaf4396671469bc6ac992c9b741fe3f8701c986e /src/lib/form/components/PembayaranTempo.jsx
parent3f849355048e5c280a35a5747577e5296b90e9fd (diff)
parent0550b0dbe9b8e369cfe211b78ab0de49a6e1f49d (diff)
Merge branch 'release' into feature/all-promotion
Diffstat (limited to 'src/lib/form/components/PembayaranTempo.jsx')
-rw-r--r--src/lib/form/components/PembayaranTempo.jsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/form/components/PembayaranTempo.jsx b/src/lib/form/components/PembayaranTempo.jsx
index 8c624fe2..73ceee49 100644
--- a/src/lib/form/components/PembayaranTempo.jsx
+++ b/src/lib/form/components/PembayaranTempo.jsx
@@ -1,12 +1,15 @@
import getFileBase64 from '@/core/utils/getFileBase64'
import { yupResolver } from '@hookform/resolvers/yup'
-import React, { useRef } from 'react'
+import React, { useEffect, useRef } from 'react'
import ReCAPTCHA from 'react-google-recaptcha'
import { useForm } from 'react-hook-form'
import { toast } from 'react-hot-toast'
import * as Yup from 'yup'
import createLeadApi from '../api/createLeadApi'
import PageContent from '@/lib/content/components/PageContent'
+import { useRouter } from 'next/router'
+
+import useAuth from '@/core/hooks/useAuth'
const PembayaranTempo = () => {
@@ -21,6 +24,15 @@ const PembayaranTempo = () => {
})
const recaptchaRef = useRef(null)
+ const router = useRouter()
+
+ const auth = useAuth()
+
+ useEffect(() => {
+ if(!auth) {
+ router.push('/login')
+ }
+ },[])
const onSubmitHandler = async (values) => {
const recaptchaValue = recaptchaRef.current.getValue()