mirror of
https://github.com/xHyroM/roles-bot.git
synced 2024-11-13 04:28:06 +01:00
23 lines
485 B
TypeScript
23 lines
485 B
TypeScript
import Discord from "@auth/core/providers/discord";
|
|
import { defineConfig } from "auth-astro";
|
|
|
|
export default defineConfig({
|
|
providers: [
|
|
Discord({
|
|
clientId: import.meta.env.DISCORD_CLIENT_ID,
|
|
clientSecret: import.meta.env.DISCORD_CLIENT_SECRET,
|
|
}),
|
|
],
|
|
callbacks: {
|
|
session({ session, token }) {
|
|
if (session.user && token?.sub) {
|
|
session.user.id = token.sub;
|
|
}
|
|
return session;
|
|
},
|
|
},
|
|
pages: {
|
|
signIn: "/auth/login",
|
|
signOut: "/auth/logout",
|
|
},
|
|
});
|