镜像自地址
https://github.com/aydenjahola/discord-multipurpose-bot.git
已同步 2025-06-30 17:36:23 +01:00
update nextauth
这个提交包含在:
父节点
43b8e55022
当前提交
01351c7441
共有 2 个文件被更改,包括 20 次插入 和 3 次删除
|
@ -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 };
|
||||
|
|
|
@ -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;
|
||||
|
|
正在加载...
在新工单中引用