diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-09-24 01:36:05 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2024-09-24 01:36:05 +0000 |
| commit | cf42512eb11b1a96c99ced8d1f867aeb8c2dcbc1 (patch) | |
| tree | 802eb86425e40b8bacda6067aa797c36598a7221 /src/pages/login.jsx | |
| parent | b7e7696d675d0c2e36364f7cbedb0483a343048d (diff) | |
| parent | 4bd29979c34c1ec3b31dd384829b008eb726769c (diff) | |
Merged in Feature/new-register (pull request #326)
Feature/new register
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' /> |
