hasura/learn-graphql

Nextjs tutorial should export authOptions

squeezeday opened this issue · 1 comments

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.

Closed via #930