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/RequestForQuotation.jsx | 10 ++++++++++
 1 file changed, 10 insertions(+)

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

diff --git a/src/lib/form/components/RequestForQuotation.jsx b/src/lib/form/components/RequestForQuotation.jsx
index fa526d5f..34434dd5 100644
--- a/src/lib/form/components/RequestForQuotation.jsx
+++ b/src/lib/form/components/RequestForQuotation.jsx
@@ -10,6 +10,9 @@ import * as Yup from 'yup'
 import createLeadApi from '../api/createLeadApi'
 import getFileBase64 from '@/core/utils/getFileBase64'
 import PageContent from '@/lib/content/components/PageContent'
+import { useRouter } from 'next/router'
+
+import useAuth from '@/core/hooks/useAuth'
 
 const RequestForQuotation = () => {
   const {
@@ -26,8 +29,15 @@ const RequestForQuotation = () => {
 
   const quotationFileRef = useRef(null)
   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((obj) => ({ value: obj.name, label: obj.name }))
-- 
cgit v1.2.3

