diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-01-02 10:26:45 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-01-02 10:26:45 +0700 |
| commit | 360498a3dd90cebffb0911d6eed32ef29299869b (patch) | |
| tree | b27f2167f478364e1867905edae02144db4fc11a /src/pages | |
| parent | cf1ca71d507118c2a97f868435cfd7ad529d965c (diff) | |
<iman> update merchant
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/daftar-merchant.jsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pages/daftar-merchant.jsx b/src/pages/daftar-merchant.jsx index c224ed0d..8616cc46 100644 --- a/src/pages/daftar-merchant.jsx +++ b/src/pages/daftar-merchant.jsx @@ -7,12 +7,22 @@ import { useRouter } from 'next/router'; export default function DaftarMerchant() { const router = useRouter(); const auth = useAuth(); + if (auth == false) { + router.push(`/login?next=${encodeURIComponent('/daftar-merchant')}`); + } + if (!auth) { + return; + } return ( <> <Seo title='Daftar Merchant - Indoteknik.com' /> <BasicLayout> - {auth?.company ? <CreateMerchant></CreateMerchant> : <ErrorMerchant />} + {auth && auth?.company ? ( + <CreateMerchant></CreateMerchant> + ) : ( + <ErrorMerchant /> + )} </BasicLayout> </> ); |
