Guest User

Untitled

a guest
Feb 17th, 2024
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //@/app/api/auth/[...nextauth]/route.ts
  2. import { authConfig } from "@/auth";
  3. import NextAuth from "next-auth/next";
  4.  
  5. const handler = NextAuth(authConfig);
  6.  
  7. export { handler as GET, handler as POST };
  8.  
  9. //@/auth.ts
  10. import { NextAuthOptions } from "next-auth";
  11. import DiscordProvider from "next-auth/providers/discord";
  12.  
  13. const scopes = ["identify", "email", "guilds"];
  14.  
  15. export const authConfig: NextAuthOptions = {
  16.   providers: [
  17.     DiscordProvider({
  18.       clientId: process.env.DISCORD_CLIENT_ID ?? "",
  19.       clientSecret: process.env.DISCORD_CLIENT_SECRET ?? "",
  20.       authorization: { params: { scope: scopes.join(" ") } },
  21.     }),
  22.   ],
  23. };
  24.  
Advertisement
Add Comment
Please, Sign In to add comment