Add duplicate submission validation with captcha and automatic submission time tracking#4
Draft
Add duplicate submission validation with captcha and automatic submission time tracking#4
Conversation
Co-authored-by: LazuliKao <46601807+LazuliKao@users.noreply.github.com>
Co-authored-by: LazuliKao <46601807+LazuliKao@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] 增加重复提交校验(反复提交需要输入验证码)增加提交时间字段
Add duplicate submission validation with captcha and automatic submission time tracking
Sep 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements duplicate submission validation and automatic submission time tracking for the freshman registration system as requested in the issue. When duplicate submissions are detected (based on email, phone, or student number), users are required to enter a captcha to proceed.
Changes Made
🔧 Schema Updates
captchafield toJoinRequestschema for verification inputFreshmanRecordschema withsubmissionTimefield for database storage🛡️ Duplicate Detection Logic
The system now detects duplicate submissions by checking if any of these fields already exist:
When a duplicate is detected:
⏰ Automatic Time Tracking
All new submissions automatically include a
submissionTimefield with the current timestamp. The existing auto-DDL system handles database schema migration seamlessly.📝 Enhanced API Response
The API now returns additional information:
{ "success": boolean, "result": FreshmanRecord | undefined, "error": string | undefined, "requiresCaptcha": boolean | undefined // New field }Example Usage
Normal submission works unchanged:
Duplicate submission requires captcha:
Security & Compatibility
Testing
The implementation uses minimal, surgical changes while providing robust duplicate detection and time tracking functionality.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
sparrow.cloudflare.com/usr/local/bin/node --no-warnings --experimental-vm-modules /home/REDACTED/work/serverless-active/serverless-active/node_modules/wrangler/wrangler-dist/cli.js deploy --dry-run(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.