diff --git a/dashboard/app/api/auth/[...nextauth]/route.ts b/dashboard/app/api/auth/[...nextauth]/route.ts index fba2cab..1895591 100644 --- a/dashboard/app/api/auth/[...nextauth]/route.ts +++ b/dashboard/app/api/auth/[...nextauth]/route.ts @@ -1,7 +1,7 @@ import NextAuth from "next-auth"; import DiscordProvider from "next-auth/providers/discord"; -export const authOptions = { +const options = { providers: [ DiscordProvider({ clientId: process.env.DISCORD_CLIENT_ID!, @@ -16,6 +16,6 @@ export const authOptions = { secret: process.env.NEXTAUTH_SECRET, }; -const handler = NextAuth(authOptions); +const handler = NextAuth(options); export { handler as GET, handler as POST }; diff --git a/dashboard/app/api/discord/channels/route.ts b/dashboard/app/api/discord/channels/route.ts index 4dd0b89..b664735 100644 --- a/dashboard/app/api/discord/channels/route.ts +++ b/dashboard/app/api/discord/channels/route.ts @@ -1,7 +1,24 @@ +// app/api/discord/channels/route.ts + import { NextResponse } from "next/server"; import axios from "axios"; import { getServerSession } from "next-auth/next"; -import { authOptions } from "../../auth/[...nextauth]/route"; +import DiscordProvider from "next-auth/providers/discord"; + +const authOptions = { + providers: [ + DiscordProvider({ + clientId: process.env.DISCORD_CLIENT_ID!, + clientSecret: process.env.DISCORD_CLIENT_SECRET!, + authorization: { + params: { + scope: "identify guilds", + }, + }, + }), + ], + secret: process.env.NEXTAUTH_SECRET, +}; const DISCORD_API_BASE = "https://discord.com/api/v10"; const BOT_TOKEN = process.env.DISCORD_BOT_TOKEN;