Added login flow
This commit is contained in:
@@ -1,7 +1,14 @@
|
||||
import '../styles/globals.css'
|
||||
import type { AppProps } from 'next/app'
|
||||
import "../styles/globals.css"
|
||||
import type { AppProps } from "next/app"
|
||||
import useSession from "../hooks/useSession"
|
||||
import { useEffect } from "react"
|
||||
|
||||
function MyApp({ Component, pageProps }: AppProps) {
|
||||
const loadSession = useSession((state) => state.load)
|
||||
useEffect(() => {
|
||||
loadSession()
|
||||
}, [loadSession])
|
||||
|
||||
return <Component {...pageProps} />
|
||||
}
|
||||
|
||||
|
9
client/pages/index.tsx
Normal file
9
client/pages/index.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { NextPage } from "next"
|
||||
import useSession from "../hooks/useSession"
|
||||
|
||||
const IndexPage: NextPage = () => {
|
||||
const session = useSession()
|
||||
return <div>{JSON.stringify(session.session || {})}</div>
|
||||
}
|
||||
|
||||
export default IndexPage
|
Reference in New Issue
Block a user