diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-18 14:39:16 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-18 14:39:16 +0700 |
| commit | b8b3b1df835d429920975e023d956b7c6ca33f43 (patch) | |
| tree | d2488bf9c67d03ec5e9c686b17b0f994f3da6c77 /src/pages/login.jsx | |
| parent | ab0782b5cf7b65930b0b40528b9205f3f0dfc3a0 (diff) | |
| parent | baa9b1e32c0afabf074f6c181274312d757a7099 (diff) | |
Merge branch 'Feature/new-register' into Feature/switch-account
Diffstat (limited to 'src/pages/login.jsx')
| -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' /> |
