From 0453bafa63ccd1057279a1be9286b3e7ebcb62d2 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 24 Mar 2025 01:29:33 -0400 Subject: Depcreating web server, returning back to using Discord as settings --- web/bun.lockb | Bin 154951 -> 154951 bytes web/package.json | 8 ++++---- web/src/app/components/Guilds.jsx | 12 ++++++------ web/src/app/dashboard/page.js | 18 +++++++++++++++--- web/src/lib/auth.js | 7 ------- 5 files changed, 25 insertions(+), 20 deletions(-) (limited to 'web') diff --git a/web/bun.lockb b/web/bun.lockb index 4a7df2d..8f54964 100644 Binary files a/web/bun.lockb and b/web/bun.lockb differ diff --git a/web/package.json b/web/package.json index 5bac297..8e69990 100644 --- a/web/package.json +++ b/web/package.json @@ -9,16 +9,16 @@ "lint": "next lint" }, "dependencies": { - "next": "15.2.3", + "next": "^15.2.3", "next-auth": "^5.0.0-beta.25", "react": "^19.0.0", "react-dom": "^19.0.0" }, "devDependencies": { - "@tailwindcss/postcss": "^4", - "tailwindcss": "^4", + "@eslint/eslintrc": "^3", + "@tailwindcss/postcss": "^4.0.15", "eslint": "^9", "eslint-config-next": "15.2.3", - "@eslint/eslintrc": "^3" + "tailwindcss": "^4.0.15" } } diff --git a/web/src/app/components/Guilds.jsx b/web/src/app/components/Guilds.jsx index 50baa98..38626e4 100644 --- a/web/src/app/components/Guilds.jsx +++ b/web/src/app/components/Guilds.jsx @@ -8,18 +8,18 @@ export default async function Guilds({session}) { }); const guilds = await response.json(); + const ADMINISTRATOR = 0x0000000000000008; const MANAGE_GUILD = 0x00000020; const filteredGuilds = guilds.filter((guild) => { // Convert permissions string to a BigInt for bitwise operations const permissions = BigInt(guild.permissions); - // Check if MANAGE_GUILD bit is set - return (permissions & BigInt(MANAGE_GUILD)) === BigInt(MANAGE_GUILD); - }); + // Check if user is owner, has ADMINISTRATOR or MANAGE_GUILD permissions + return guild.owner || + (permissions & BigInt(ADMINISTRATOR)) === BigInt(ADMINISTRATOR) || + (permissions & BigInt(MANAGE_GUILD)) === BigInt(MANAGE_GUILD); }); return filteredGuilds.map((guild) => ( -
-

{guild.name}

-
+
{guild.name}
)) } diff --git a/web/src/app/dashboard/page.js b/web/src/app/dashboard/page.js index d6e3a41..bab3bd8 100644 --- a/web/src/app/dashboard/page.js +++ b/web/src/app/dashboard/page.js @@ -8,7 +8,7 @@ export default async function Home() { if (!session) redirect("/"); return ( -
+ <> - -
+
+
+
Settings
+ +
+
+

Logging

+

Channel 1

+

Channel 2

+

Quote of the Day

+

LLM Chatbot

+
+
+ ) } diff --git a/web/src/lib/auth.js b/web/src/lib/auth.js index 3f78f94..28c34f1 100644 --- a/web/src/lib/auth.js +++ b/web/src/lib/auth.js @@ -4,13 +4,6 @@ import Discord from "next-auth/providers/discord" export const { handlers, signIn, signOut, auth } = NextAuth({ providers: [Discord({ authorization: { - profile(profile) { - return { - id: profile.id, - name: profile.username, - image: profile.image_url - } - }, url: "https://discord.com/api/oauth2/authorize", params: { scope: "identify guilds" }, } -- cgit v1.2.3