discord-multipurpose-bot/dashboard/app/api/auth/[...nextauth]/route.ts

22 lines
486 B
TypeScript
Raw Normal View History

2024-10-29 13:00:28 +00:00
import NextAuth from "next-auth";
import DiscordProvider from "next-auth/providers/discord";
2024-10-29 13:09:09 +00:00
const options = {
2024-10-29 13:00:28 +00:00
providers: [
DiscordProvider({
clientId: process.env.DISCORD_CLIENT_ID!,
clientSecret: process.env.DISCORD_CLIENT_SECRET!,
authorization: {
params: {
scope: "identify guilds",
},
},
}),
],
secret: process.env.NEXTAUTH_SECRET,
};
2024-10-29 13:09:09 +00:00
const handler = NextAuth(options);
2024-10-29 13:00:28 +00:00
export { handler as GET, handler as POST };