From f7701abcbe05510c3672c4768df03fee535956e3 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Tue, 30 Jan 2024 09:03:20 +0700
Subject: handling form form

---
 src/lib/form/components/SuratDukungan.jsx | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'src/lib/form/components/SuratDukungan.jsx')

diff --git a/src/lib/form/components/SuratDukungan.jsx b/src/lib/form/components/SuratDukungan.jsx
index d73c3fab..0b3b650e 100644
--- a/src/lib/form/components/SuratDukungan.jsx
+++ b/src/lib/form/components/SuratDukungan.jsx
@@ -10,6 +10,9 @@ import createLeadsApi from '../api/createLeadApi';
 
 import PageContent from '@/lib/content/components/PageContent';
 
+import useAuth from '@/core/hooks/useAuth'
+import { useRouter } from 'next/router';
+
 const CreateSuratDukungan = () => {
   const {
     register,
@@ -25,8 +28,14 @@ const CreateSuratDukungan = () => {
   const [company_unit, setCompany_unit] = useState([]);
 
   const recaptchaRef = useRef(null);
+  const router = useRouter()
+
+  const auth = useAuth()
 
   useEffect(() => {
+    if(!auth) {
+      router.push('/login')
+    }
     const loadCities = async () => {
       let dataCities = await cityApi();
       dataCities = dataCities.map((city) => ({
-- 
cgit v1.2.3

