mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2024-11-22 08:45:55 +00:00
update nextauth
This commit is contained in:
parent
43b8e55022
commit
01351c7441
2 changed files with 20 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
import NextAuth from "next-auth";
|
import NextAuth from "next-auth";
|
||||||
import DiscordProvider from "next-auth/providers/discord";
|
import DiscordProvider from "next-auth/providers/discord";
|
||||||
|
|
||||||
export const authOptions = {
|
const options = {
|
||||||
providers: [
|
providers: [
|
||||||
DiscordProvider({
|
DiscordProvider({
|
||||||
clientId: process.env.DISCORD_CLIENT_ID!,
|
clientId: process.env.DISCORD_CLIENT_ID!,
|
||||||
|
@ -16,6 +16,6 @@ export const authOptions = {
|
||||||
secret: process.env.NEXTAUTH_SECRET,
|
secret: process.env.NEXTAUTH_SECRET,
|
||||||
};
|
};
|
||||||
|
|
||||||
const handler = NextAuth(authOptions);
|
const handler = NextAuth(options);
|
||||||
|
|
||||||
export { handler as GET, handler as POST };
|
export { handler as GET, handler as POST };
|
||||||
|
|
|
@ -1,7 +1,24 @@
|
||||||
|
// app/api/discord/channels/route.ts
|
||||||
|
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { getServerSession } from "next-auth/next";
|
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 DISCORD_API_BASE = "https://discord.com/api/v10";
|
||||||
const BOT_TOKEN = process.env.DISCORD_BOT_TOKEN;
|
const BOT_TOKEN = process.env.DISCORD_BOT_TOKEN;
|
||||||
|
|
Loading…
Reference in a new issue