Enhance verification system with multi-provider support and alt-account detection
- Added support for multiple captcha providers including Google reCAPTCHA (v2 and v3), hCaptcha, and Cloudflare Turnstile. - Introduced new fields in the verification configuration for selecting captcha providers and enabling alt-account detection. - Implemented logic to handle verification attempts and flag potential alt accounts based on IP and invite code analysis. - Updated environment configuration to include necessary keys for captcha providers. - Enhanced the user interface to allow selection of captcha providers in the verification setup. - Improved backend handling of verification records to store additional data related to captcha provider usage.
This commit is contained in:
@@ -20,6 +20,7 @@ model Guild {
|
||||
logChannels LogChannel[]
|
||||
welcomeConfig WelcomeConfig?
|
||||
verificationConfig VerificationConfig?
|
||||
verificationRecords VerificationRecord[]
|
||||
levelingConfig LevelingConfig?
|
||||
memberLevels MemberLevel[]
|
||||
levelRewards LevelReward[]
|
||||
@@ -263,20 +264,47 @@ model WelcomeConfig {
|
||||
}
|
||||
|
||||
model VerificationConfig {
|
||||
id String @id @default(cuid())
|
||||
guildId String @unique
|
||||
enabled Boolean @default(false)
|
||||
channelId String?
|
||||
verifiedRoleId String?
|
||||
unverifiedRoleId String?
|
||||
mode String @default("BUTTON")
|
||||
minAccountAgeDays Int @default(0)
|
||||
failAction String @default("KICK")
|
||||
panelChannelId String?
|
||||
panelMessageId String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
id String @id @default(cuid())
|
||||
guildId String @unique
|
||||
enabled Boolean @default(false)
|
||||
channelId String?
|
||||
verifiedRoleId String?
|
||||
unverifiedRoleId String?
|
||||
mode String @default("BUTTON")
|
||||
/// MATH | RECAPTCHA_V2 | RECAPTCHA_V3 | HCAPTCHA | TURNSTILE
|
||||
captchaProvider String @default("MATH")
|
||||
minAccountAgeDays Int @default(0)
|
||||
failAction String @default("KICK")
|
||||
altDetectionEnabled Boolean @default(false)
|
||||
altBlockOnMatch Boolean @default(true)
|
||||
altIpWindowDays Int @default(30)
|
||||
altInviteWindowHours Int @default(48)
|
||||
altMaxAccountsPerInvite Int @default(3)
|
||||
panelChannelId String?
|
||||
panelMessageId String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
/// One row per successful (or blocked-as-alt) verification attempt fingerprint.
|
||||
model VerificationRecord {
|
||||
id String @id @default(cuid())
|
||||
guildId String
|
||||
userId String
|
||||
inviteCode String?
|
||||
inviterId String?
|
||||
ipHash String?
|
||||
userAgentHash String?
|
||||
captchaProvider String?
|
||||
flaggedAsAlt Boolean @default(false)
|
||||
matchedUserId String?
|
||||
createdAt DateTime @default(now())
|
||||
guild Guild @relation(fields: [guildId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([guildId, userId])
|
||||
@@index([guildId, ipHash, createdAt])
|
||||
@@index([guildId, inviteCode, createdAt])
|
||||
}
|
||||
|
||||
model LevelingConfig {
|
||||
|
||||
Reference in New Issue
Block a user