fix: errors when building

This commit is contained in:
trafficlunar 2025-03-29 18:32:35 +00:00
parent 905547ec6f
commit a1cd520042
2 changed files with 5 additions and 8 deletions

View file

@ -1,8 +1,8 @@
import NextAuth, { AuthOptions } from "next-auth"; import NextAuth from "next-auth";
import Discord from "next-auth/providers/discord"; import Discord from "next-auth/providers/discord";
import Github from "next-auth/providers/github"; import Github from "next-auth/providers/github";
export const authOptions: AuthOptions = { const handler = NextAuth({
pages: { pages: {
signIn: "/login", signIn: "/login",
}, },
@ -16,8 +16,6 @@ export const authOptions: AuthOptions = {
clientSecret: process.env.GITHUB_SECRET!, clientSecret: process.env.GITHUB_SECRET!,
}), }),
], ],
}; });
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST }; export { handler as GET, handler as POST };

View file

@ -1,11 +1,10 @@
import { getServerSession } from "next-auth"; import { getServerSession } from "next-auth";
import { authOptions } from "../api/auth/[...nextauth]/route";
import LoginButtons from "../components/login-buttons"; import LoginButtons from "../components/login-buttons";
import { redirect, RedirectType } from "next/navigation"; import { redirect } from "next/navigation";
export default async function LoginPage() { export default async function LoginPage() {
const session = await getServerSession(authOptions); const session = await getServerSession();
// If the user is already logged in, redirect // If the user is already logged in, redirect
if (session) { if (session) {