diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-03-25 14:13:06 -0400 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-03-25 14:13:06 -0400 |
| commit | 1c12d378d66b92b1674acd17640f2bac752da289 (patch) | |
| tree | bc8a1ef5047be1ed2400f2204a0222a840375851 /web/src/lib | |
| parent | ad768e2b25b58d62a44aa2daeb1429a651d488e5 (diff) | |
| download | AleeBot-1c12d378d66b92b1674acd17640f2bac752da289.tar.gz AleeBot-1c12d378d66b92b1674acd17640f2bac752da289.tar.bz2 AleeBot-1c12d378d66b92b1674acd17640f2bac752da289.zip | |
Converted public dashboard to admin dashboard; Made API have a consistent output message
Diffstat (limited to 'web/src/lib')
| -rw-r--r-- | web/src/lib/auth.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/web/src/lib/auth.js b/web/src/lib/auth.js deleted file mode 100644 index 28c34f1..0000000 --- a/web/src/lib/auth.js +++ /dev/null @@ -1,32 +0,0 @@ -import NextAuth from "next-auth" -import Discord from "next-auth/providers/discord" - -export const { handlers, signIn, signOut, auth } = NextAuth({ - providers: [Discord({ - authorization: { - url: "https://discord.com/api/oauth2/authorize", - params: { scope: "identify guilds" }, - } - })], - callbacks: { - async jwt({ token, account }) { - // Persist the OAuth access_token to the token right after sign in - if (account) { - token.accessToken = account.access_token; - } - return token; - }, - async session({ session, token }) { - if (token.accessToken) { - session.user = await fetch('https://discord.com/api/users/@me', { - headers: { - authorization: `Bearer ${token.accessToken}` - } - }).then((r) => r.json()); - session.accessToken = token.accessToken; - } - - return session; - } - } -}) |
