mirror of
https://github.com/xHyroM/roles-bot.git
synced 2024-11-14 04:58:07 +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",
|
||
|
},
|
||
|
});
|