feat: login page with nextauth.js

This commit is contained in:
trafficlunar 2025-03-28 22:23:56 +00:00
parent 599c59bb38
commit a0f3aed326
7 changed files with 77 additions and 3 deletions

View file

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