Skip to content

Commit f7b54db

Browse files
author
xyzjesper
committed
Fixed Auth bug from Verification Module (Security)
1 parent 4e536d3 commit f7b54db

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

src/modules/security/modals/security-gate-verification-button-modal.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,20 @@ export default {
9393
// });
9494
// }
9595

96-
message?.edit({
96+
await message?.edit({
9797
components: [
9898
new ActionRowBuilder<ButtonBuilder>().addComponents(
9999
(() => {
100100
const button = new ButtonBuilder()
101-
.setCustomId(`security-gate-verification-verify:${data?.UUID}`)
102101
.setLabel(label)
103102
.setStyle(styleNumber ?? ButtonStyle.Secondary);
104103
if (emoji) {
105104
button.setEmoji(emoji);
106105
}
107-
// TODO: Replace with actual URL if needed
108106
if (data.ActionType == VerificationActionType.Authorize) {
109107
button.setURL(Config.Modules.Verification.VerifyAuthUrl + "&state=" + data.UUID);
108+
} else {
109+
button.setCustomId(`security-gate-verification-verify:${data?.UUID}`)
110110
}
111111
return button;
112112
})()

src/modules/security/selectmenus/security-gate-verification-action-role-select.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ import {database} from "../../../main/database.js";
1818
export default {
1919
id: "security-gate-verification-action-role-select",
2020
type: DisBotInteractionType.SelectMenu,
21-
options: {
22-
once: false,
23-
permission: PermissionType.SecurityGate,
24-
cooldown: 3000, // 3 seconds
25-
botPermissions: [],
26-
userPermissions: [PermissionFlagsBits.ManageGuild],
27-
userHasOnePermission: true,
28-
isGuildOwner: false
29-
},
3021

3122
/**
3223
* @param {AnySelectMenuInteraction} interaction
@@ -43,12 +34,12 @@ export default {
4334
const data = await database.verificationGates.findFirst
4435
({
4536
where: {
46-
UUID: value
37+
UUID: uuid
4738
}
4839
});
4940

5041
if (!data) {
51-
return interaction.reply({
42+
return await interaction.reply({
5243
content: `## ${await convertToEmojiPng("error", client.user.id)} Verification Gate not found`,
5344
flags: MessageFlags.Ephemeral
5445
});
@@ -62,15 +53,15 @@ export default {
6253
await database.verificationGates.update(
6354
{
6455
where: {
65-
UUID: value
56+
UUID: uuid
6657
},
6758
data: {
6859
Roles: data.Roles
6960
}
7061
}
7162
);
7263

73-
interaction.update({
64+
await interaction.update({
7465
content: `## ${await convertToEmojiPng("check", client.user.id)} Role has been ${data.Roles.includes(value) ? "added" : "removed"} to the security gate verification action.`,
7566
})
7667
}

0 commit comments

Comments
 (0)