about summary refs log tree commit diff
path: root/src/pages/Home.tsx
blob: 624681a37f4f2c143078a7863f66d607e4102aaa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { useEffect } from "react"

import { useNavigate } from "react-router-dom"

export default function Home(props: any) {
  const navigate = useNavigate()

  useEffect(() => {
    if (!props.session) {
      navigate('/login')
    }
  }, [props.session])

  return (
    <>
      <div>
        <h1>Home</h1>
        <p>Logged in to access your account: {JSON.stringify(props.session)}</p>
      </div>
    </>
  )
}