diff --git a/src/app/api/auth/[...nextauth]/route.ts b/src/app/api/auth/[...nextauth]/route.ts index 2ea33c3..f29c23a 100644 --- a/src/app/api/auth/[...nextauth]/route.ts +++ b/src/app/api/auth/[...nextauth]/route.ts @@ -1,8 +1,8 @@ -import NextAuth, { AuthOptions } from "next-auth"; +import NextAuth from "next-auth"; import Discord from "next-auth/providers/discord"; import Github from "next-auth/providers/github"; -export const authOptions: AuthOptions = { +const handler = NextAuth({ pages: { signIn: "/login", }, @@ -16,8 +16,6 @@ export const authOptions: AuthOptions = { clientSecret: process.env.GITHUB_SECRET!, }), ], -}; - -const handler = NextAuth(authOptions); +}); export { handler as GET, handler as POST }; diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index ccf34ef..c752048 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,11 +1,10 @@ import { getServerSession } from "next-auth"; -import { authOptions } from "../api/auth/[...nextauth]/route"; import LoginButtons from "../components/login-buttons"; -import { redirect, RedirectType } from "next/navigation"; +import { redirect } from "next/navigation"; export default async function LoginPage() { - const session = await getServerSession(authOptions); + const session = await getServerSession(); // If the user is already logged in, redirect if (session) {