98 | );
99 | }
100 |
101 | export default Dashboard;
102 |
--------------------------------------------------------------------------------
/pages/index.js:
--------------------------------------------------------------------------------
1 | import Head from "next/head";
2 | import { useRouter } from "next/router";
3 | import { useEffect } from "react";
4 | import { useMoralis } from "react-moralis";
5 |
6 | export default function Home() {
7 | const { authenticate, isAuthenticated } = useMoralis();
8 | const router = useRouter();
9 |
10 | useEffect(() => {
11 | if (isAuthenticated) router.push("/dashboard");
12 | }, [isAuthenticated]);
13 |
14 | return (
15 |