From 05e7c0b4385b747d0fd4101b36f6a431caf1c8fa Mon Sep 17 00:00:00 2001 From: Josh Wooding <12938082+joshwooding@users.noreply.github.com> Date: Sat, 9 Nov 2024 18:08:08 +0000 Subject: [PATCH] Move next-auth to app router --- .../api/auth/[...nextauth]/route.ts} | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename packages/site/src/{pages/api/auth/[...nextauth].ts => app/api/auth/[...nextauth]/route.ts} (68%) diff --git a/packages/site/src/pages/api/auth/[...nextauth].ts b/packages/site/src/app/api/auth/[...nextauth]/route.ts similarity index 68% rename from packages/site/src/pages/api/auth/[...nextauth].ts rename to packages/site/src/app/api/auth/[...nextauth]/route.ts index 68775f0e..d01ea720 100644 --- a/packages/site/src/pages/api/auth/[...nextauth].ts +++ b/packages/site/src/app/api/auth/[...nextauth]/route.ts @@ -1,7 +1,7 @@ import NextAuth, { NextAuthOptions } from 'next-auth'; import GithubProvider from 'next-auth/providers/github'; -export const authOptions: NextAuthOptions = { +const authOptions: NextAuthOptions = { providers: [ GithubProvider({ clientId: process.env.GITHUB_ID as string, @@ -9,4 +9,7 @@ export const authOptions: NextAuthOptions = { }) ] }; -export default NextAuth(authOptions); + +const handler = NextAuth(authOptions); + +export { handler as GET, handler as POST };