From a1cd520042c46bec6389485e00e9ca173ce2247a Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Sat, 29 Mar 2025 18:32:35 +0000 Subject: [PATCH] fix: errors when building --- src/app/api/auth/[...nextauth]/route.ts | 8 +++----- src/app/login/page.tsx | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) 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) {