Added login flow

This commit is contained in:
2022-10-16 21:02:41 +02:00
parent 4afe2f906d
commit a627addad5
14 changed files with 303 additions and 80 deletions

View File

@@ -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
View 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