diff --git a/src/app/api/auth/[...nextauth]/route.ts b/src/app/api/auth/[...nextauth]/route.ts index 6d6b15c..9cc5077 100644 --- a/src/app/api/auth/[...nextauth]/route.ts +++ b/src/app/api/auth/[...nextauth]/route.ts @@ -1,8 +1,8 @@ -import NextAuth from 'next-auth'; -import { authConfig } from '@/auth.config'; +import { handlers, auth, signIn, signOut } from '@/auth'; -export const { handlers, auth, signIn, signOut } = NextAuth(authConfig); +export const { GET, POST } = handlers; -export const GET = handlers.GET; -export const POST = handlers.POST; +export { auth, signIn, signOut }; + +export const runtime = "nodejs"; diff --git a/src/auth.ts b/src/auth.ts index 563393a..caf447f 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -2,6 +2,6 @@ import NextAuth from 'next-auth'; import { authConfig } from './auth.config'; -const { handlers, auth, signIn, signOut } = NextAuth(authConfig); +export const { handlers, auth, signIn, signOut } = NextAuth(authConfig); -export { handlers, auth, signIn, signOut }; +export const runtime = "nodejs"; diff --git a/src/middleware.ts b/src/middleware.ts index 4441e95..d9d8e3e 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -1,10 +1,9 @@ -import { auth } from '@/auth'; - -export default auth; +import NextAuth from 'next-auth'; +import { authConfig } from '@/auth.config'; + +export default NextAuth(authConfig).auth; -export const runtime = 'nodejs'; - export const config = { // https://nextjs.org/docs/app/building-your-application/routing/middleware#matcher matcher: ['/((?!api|_next/static|_next/image|favicon.ico).*)'],