Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@/app/api/auth/[...nextauth]/route.ts
- import { authConfig } from "@/auth";
- import NextAuth from "next-auth/next";
- const handler = NextAuth(authConfig);
- export { handler as GET, handler as POST };
- //@/auth.ts
- import { NextAuthOptions } from "next-auth";
- import DiscordProvider from "next-auth/providers/discord";
- const scopes = ["identify", "email", "guilds"];
- export const authConfig: NextAuthOptions = {
- providers: [
- DiscordProvider({
- clientId: process.env.DISCORD_CLIENT_ID ?? "",
- clientSecret: process.env.DISCORD_CLIENT_SECRET ?? "",
- authorization: { params: { scope: scopes.join(" ") } },
- }),
- ],
- };
Advertisement
Add Comment
Please, Sign In to add comment