diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-18 10:55:35 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-18 10:55:35 +0700 |
| commit | baa9b1e32c0afabf074f6c181274312d757a7099 (patch) | |
| tree | 7faa0459d6891bde9d1a7a8ba58f184d3156e43a /src | |
| parent | 4aface3ba2fa7c74a152ac0fe03b9e32e3ef68e1 (diff) | |
<iman> update no login page if auth
Diffstat (limited to 'src')
| -rw-r--r-- | src/pages/login.jsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pages/login.jsx b/src/pages/login.jsx index 9a1aa85b..07d13784 100644 --- a/src/pages/login.jsx +++ b/src/pages/login.jsx @@ -1,3 +1,5 @@ +import { useEffect } from 'react'; +import { useRouter } from 'next/router'; import Seo from '@/core/components/Seo'; import SimpleFooter from '@/core/components/elements/Footer/SimpleFooter'; import BasicLayout from '@/core/components/layouts/BasicLayout'; @@ -5,8 +7,18 @@ import DesktopView from '@/core/components/views/DesktopView'; import MobileView from '@/core/components/views/MobileView'; import LoginComponent from '@/lib/auth/components/Login'; import AccountActivation from '~/modules/account-activation'; +import useAuth from '@/core/hooks/useAuth'; export default function Login() { + const router = useRouter(); + const auth = useAuth(); + + useEffect(() => { + if (auth) { + router.push('/'); + } + }, [auth, router]); + return ( <> <Seo title='Login - Indoteknik.com' /> |
