diff --git a/src/app/account/page.tsx b/src/app/account/page.tsx index f922196..05f2fdd 100644 --- a/src/app/account/page.tsx +++ b/src/app/account/page.tsx @@ -3,15 +3,30 @@ import { HomeButton } from '@/app/components/HomeButton' import { DiscordButton } from '@/app/components/DiscordButton' import { getCookie } from '@/util/cookie' +import { useEffect, useState } from 'react' +import { useRouter } from 'next/navigation' export default function AccountLoginPage () { + const [loading, setLoading] = useState(true) + const router = useRouter() + + useEffect(() => { + const token = getCookie('accountToken', '-1') + if (token === '-1') { + router.push('/account/login') + } else setLoading(false) + }, [router]) + return (

- Nothing on this page yet! You are logged in as{' '} - {getCookie('accountUsername', 'N/A')}. + {loading + ? 'Loading...' + : 'Nothing on this page yet! You are logged in as ' + + getCookie('accountUsername', 'N/A') + + '.'}

)