hasura / learn-graphql

Real world GraphQL tutorials for frontend developers with deadlines!
https://hasura.io/learn/
MIT License
1.19k stars 647 forks source link

Nextjs tutorial should export authOptions #929

Closed squeezeday closed 1 year ago

squeezeday commented 1 year ago

In the example at https://github.com/hasura/learn-graphql/blob/master/tutorials/backend/hasura-authentication/tutorial-site/content/integrations/nextjs-auth.md

export default NextAuth({

Should be

export const authOptions: NextAuthOptions = {
...
}
export default NextAuth(authOptions)

See next-auth-example: https://github.com/nextauthjs/next-auth-example/blob/main/pages/api/auth/%5B...nextauth%5D.ts

The exported authOptions is needed when using getServerSession: const session = await getServerSession(req, res, authOptions)

I am working on a pull request for this issue.

praveenweb commented 1 year ago

Closed via https://github.com/hasura/learn-graphql/pull/930