From 2f21f670e076f6a6714fd8e8ac34c6a33fc6b94b Mon Sep 17 00:00:00 2001 From: Parker2991 Date: Thu, 16 Oct 2025 10:54:53 -0500 Subject: [PATCH] remove validation bypass as it is a big validation issue --- src/commands/trusted/auth.js | 59 ----------------------------------- src/modules/auth.js | 32 ------------------- src/modules/commandManager.js | 10 +----- 3 files changed, 1 insertion(+), 100 deletions(-) delete mode 100644 src/commands/trusted/auth.js delete mode 100644 src/modules/auth.js diff --git a/src/commands/trusted/auth.js b/src/commands/trusted/auth.js deleted file mode 100644 index 52e4c68..0000000 --- a/src/commands/trusted/auth.js +++ /dev/null @@ -1,59 +0,0 @@ -const CommandContext = require("../../commandUtil/CommandContext"); -const trustLevel = require("../../commandUtil/CommandTrustLevel"); - -class auth extends CommandContext { - constructor() { - super( - "auth", - ["authentication"], - "auth through the bot so you dont need to use a hash everytime", - trustLevel.trusted, - [""], - ); - } - execute(context) { - const bot = context.bot; - const args = context.arguments; - const source = context.source; - const config = context.config; - const uuid = source.player.uuid; - let component = [] - if (source.player.validateBypass) - throw new CommandError(`You are already authed!`); - - if (source.player.trustLevel === 1) { - bot.auth.add({ - player: uuid, - trustLevel: "trusted", - }); - - component.push({ - text: "Authed as Trusted", - color: config.colors.help.trusted - }) - } else if (source.player.trustLevel === 2) { - bot.auth.add({ - player: uuid, - trustLevel: "admin", - }); - - component.push({ - text: "Authed as Admin", - color: config.colors.help.admin - }) - } else if (source.player.trustLevel === 3) { - bot.auth.add({ - player: source.player.uuid, - trustLevel: "owner", - }); - component.push({ - text: "Authed as Owner", - color: config.colors.help.owner - }) - } - - source.sendFeedback(component) - } -} - -module.exports = auth; diff --git a/src/modules/auth.js b/src/modules/auth.js deleted file mode 100644 index 437887d..0000000 --- a/src/modules/auth.js +++ /dev/null @@ -1,32 +0,0 @@ -class auth { - constructor(context) { - const bot = context.bot; - const options = context.options; - const config = context.config; - - bot.auth = { - list: [], - find(player) { - this.list.find(); - }, - add(player) { - this.list.push(player); - }, - remove(player) { - this.list.splice(player, 1); - }, - clear() { - this.list = []; - }, - }; - - bot.on("end", () => bot.auth.clear()); - - bot.on("player_left", (data) => { - const players = bot.auth.list.find((e) => e?.player === data[0])?.player; - if (players === data[0]) bot.auth.remove(data); - }); - } -} - -module.exports = auth; diff --git a/src/modules/commandManager.js b/src/modules/commandManager.js index bf4c60a..da2e866 100644 --- a/src/modules/commandManager.js +++ b/src/modules/commandManager.js @@ -21,7 +21,6 @@ class commandManager { const command = this.getCommand(commandName.toLowerCase()); try { - const authFind = bot.auth.list.find((e) => e.player === source.player.uuid) if (!command) { throw new CommandError({ translate: "%s%s%s %s", @@ -35,15 +34,8 @@ class commandManager { }) } - if (authFind) { - source.player.validateBypass = true - if (authFind.trustLevel === "trusted") source.player.trustLevel = 1; - else if (authFind.trustLevel === "admin") source.player.trustLevel = 2; - else if (authFind.trustLevel === "owner") source.player.trustLevel = 3; - } - if (command?.data?.trustLevel !== 0 && command?.data.trustLevel < 4) { - if (!source.player.validateBypass && !source.sources.console && !source.sources.discord) { + if (!source.sources.console && !source.sources.discord) { if (args[0] === bot.validation.trusted) source.player.trustLevel = 1 else if (args[0] === bot.validation.admin)