feat: add email verification code for registration and optimize email service
- Add POST /user/email/code endpoint to send 6-digit verification code - Require email code verification before completing registration - Add email code cache with 10min TTL and 5/day send rate limit - Fix nil client guard, TLS conn leak, domain parsing, and Resend error body in email pkg - Deploy via ssh inline command using current branch Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,9 +23,16 @@ type UserInfoResponse struct {
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
type EmailCodeSendRequest struct {
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
}
|
||||
|
||||
type EmailCodeSendResponse struct{}
|
||||
|
||||
type EmailRegisterRequest struct {
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
Password string `json:"password" binding:"required,min=6"`
|
||||
Code string `json:"code" binding:"required"`
|
||||
}
|
||||
|
||||
type EmailRegisterResponse struct {
|
||||
|
||||
Reference in New Issue
Block a user