pnpm build
This commit is contained in:
@@ -1,24 +1,5 @@
|
||||
import NextAuth, { NextAuthOptions } from 'next-auth';
|
||||
import DiscordProvider from 'next-auth/providers/discord';
|
||||
|
||||
export const authOptions: NextAuthOptions = {
|
||||
providers: [
|
||||
DiscordProvider({
|
||||
clientId: process.env.DISCORD_CLIENT_ID!,
|
||||
clientSecret: process.env.DISCORD_CLIENT_SECRET!,
|
||||
}),
|
||||
],
|
||||
callbacks: {
|
||||
async session({ session, token }) {
|
||||
if (session.user && token.sub) {
|
||||
session.user.id = token.sub;
|
||||
} else {
|
||||
session.user.id = '';
|
||||
}
|
||||
return session;
|
||||
},
|
||||
}
|
||||
};
|
||||
import { authOptions } from "@/lib/auth";
|
||||
import NextAuth from "next-auth";
|
||||
|
||||
const handler = NextAuth(authOptions);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user