diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2024-01-30 09:03:20 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2024-01-30 09:03:20 +0700 |
| commit | f7701abcbe05510c3672c4768df03fee535956e3 (patch) | |
| tree | 29cf4ff30aae1798ea32c6a635dc59441073e4e3 /src/lib/form/components/PembayaranTempo.jsx | |
| parent | ceb2f3ef22b87378727aa8174d9e41952b72ee36 (diff) | |
handling form form
Diffstat (limited to 'src/lib/form/components/PembayaranTempo.jsx')
| -rw-r--r-- | src/lib/form/components/PembayaranTempo.jsx | 14 |
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() |
