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:
smueller
2026-07-23 11:28:58 +02:00
parent e24f99ad38
commit 04e9ffad28
27 changed files with 1274 additions and 207 deletions

View File

@@ -207,13 +207,28 @@ export type VerificationMode = z.infer<typeof VerificationModeSchema>;
export const VerificationFailActionSchema = z.enum(['KICK', 'BAN', 'NONE']);
export type VerificationFailAction = z.infer<typeof VerificationFailActionSchema>;
export const CaptchaProviderSchema = z.enum([
'MATH',
'RECAPTCHA_V2',
'RECAPTCHA_V3',
'HCAPTCHA',
'TURNSTILE'
]);
export type CaptchaProvider = z.infer<typeof CaptchaProviderSchema>;
export const VerificationSetupSchema = z.object({
channel: z.string().min(1),
verifiedRole: z.string().min(1),
unverifiedRole: z.string().optional(),
mode: VerificationModeSchema.default('BUTTON'),
captchaProvider: CaptchaProviderSchema.default('MATH'),
minAccountAgeDays: z.number().int().nonnegative().default(0),
failAction: VerificationFailActionSchema.default('KICK')
failAction: VerificationFailActionSchema.default('KICK'),
altDetectionEnabled: z.boolean().default(false),
altBlockOnMatch: z.boolean().default(true),
altIpWindowDays: z.number().int().min(1).max(365).default(30),
altInviteWindowHours: z.number().int().min(1).max(720).default(48),
altMaxAccountsPerInvite: z.number().int().min(1).max(50).default(3)
});
export type VerificationSetup = z.infer<typeof VerificationSetupSchema>;