I am using Next.js v14 and next-auth v5 beta.
I have this in my route.tsx
placed in app/api/auth/[...nextauth]/
directory:
import NextAuth from "next-auth";
import AzureADProvider from "next-auth/providers/azure-ad";
export const {
handlers: { GET, POST },
auth,
signIn,
signOut,
} = NextAuth({
providers: [
AzureADProvider({
clientId: process.env.AZURE_AD_CLIENT_ID,
clientSecret: process.env.AZURE_AD_CLIENT_SECRET,
tenantId: process.env.AZURE_AD_TENANT_ID,
})
]
})
When deploying to azure webapp, I get this error in the build process which is next build
:
app/api/auth/[...nextauth]/route.tsx
Type error: Route "app/api/auth/[...nextauth]/route.tsx" does not match the required types of a Next.js Route.
"auth" is not a valid Route export field.