Closed squeezeday closed 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)
const session = await getServerSession(req, res, authOptions)
I am working on a pull request for this issue.
Closed via https://github.com/hasura/learn-graphql/pull/930
In the example at https://github.com/hasura/learn-graphql/blob/master/tutorials/backend/hasura-authentication/tutorial-site/content/integrations/nextjs-auth.md
Should be
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.