File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,30 @@ Now we're ready to implement the signup/signin flow.
268268
269269### 6. Implement Signup/Signin
270270
271+ Firstly, NextAuth and React Query require context providers to be set up. Let's add it to ` /src/pages/_app.tsx ` :
272+
273+ ``` tsx title='/src/pages/_app.tsx'
274+ import { type AppType } from " next/app" ;
275+ import { type Session } from " next-auth" ;
276+ import { SessionProvider } from " next-auth/react" ;
277+
278+ import " ../styles/globals.css" ;
279+
280+ const MyApp: AppType <{ session: Session | null }> = ({
281+ Component ,
282+ pageProps: { session , ... pageProps },
283+ }) => {
284+ return (
285+ <SessionProvider session = { session } >
286+ <Component { ... pageProps } />
287+ </SessionProvider >
288+ );
289+ };
290+
291+ export default MyApp ;
292+ ```
293+
294+
271295Now let's implement the signup/signin pages. First, create a new page ` /src/pages/signup.tsx ` :
272296
273297``` tsx title='/src/pages/signup.tsx'
You can’t perform that action at this time.
0 commit comments