Update code

This commit is contained in:
UltraLionFr
2025-08-20 14:14:33 +02:00
parent 174cf5ef60
commit 0c1a0d74d7
53 changed files with 3830 additions and 373 deletions
+25
View File
@@ -0,0 +1,25 @@
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;
},
}
};
const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };