mirror of
https://github.com/xHyroM/roles-bot.git
synced 2024-11-24 01:01:06 +01:00
24 lines
485 B
TypeScript
24 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",
|
||
|
},
|
||
|
});
|