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:
@@ -13,8 +13,8 @@ export async function GET(_request: NextRequest, { params }: RouteParams) {
|
||||
const { guildId } = await params;
|
||||
try {
|
||||
await requireGuildAccess(guildId);
|
||||
const config = await getVerificationDashboard(guildId);
|
||||
return NextResponse.json(config);
|
||||
const payload = await getVerificationDashboard(guildId);
|
||||
return NextResponse.json(payload);
|
||||
} catch (error) {
|
||||
return toApiErrorResponse(error);
|
||||
}
|
||||
@@ -28,15 +28,19 @@ export async function PATCH(request: NextRequest, { params }: RouteParams) {
|
||||
const patch = VerificationConfigDashboardPatchSchema.parse(body);
|
||||
|
||||
const before = await getVerificationDashboard(guildId);
|
||||
const after = await updateVerificationDashboard(guildId, patch);
|
||||
const afterConfig = await updateVerificationDashboard(guildId, patch);
|
||||
const after = {
|
||||
config: afterConfig,
|
||||
availableCaptchaProviders: before.availableCaptchaProviders
|
||||
};
|
||||
|
||||
await writeDashboardAudit(prisma, {
|
||||
guildId,
|
||||
actorUserId: session.user.id,
|
||||
action: 'verification.update',
|
||||
path: `/dashboard/${guildId}/verification`,
|
||||
before,
|
||||
after
|
||||
before: before.config,
|
||||
after: afterConfig
|
||||
});
|
||||
|
||||
return NextResponse.json(after);
|
||||
|
||||
Reference in New Issue
Block a user