feat: add email verify code endpoint and require code on register
- POST /v1/user/email/code sends a 6-digit verify code via email (rate-limited, 10min TTL) - RegisterByEmail now validates verify_code before creating the account - Added email code cache helpers mirroring SMS pattern - Added error codes 1007 (email code error) and 1008 (send limit) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -23,9 +23,16 @@ type UserInfoResponse struct {
|
||||
Email string `json:"email"`
|
||||
}
|
||||
|
||||
type EmailVerifyCodeRequest struct {
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
}
|
||||
|
||||
type EmailVerifyCodeResponse struct{}
|
||||
|
||||
type EmailRegisterRequest struct {
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
Password string `json:"password" binding:"required,min=6"`
|
||||
Email string `json:"email" binding:"required,email"`
|
||||
Password string `json:"password" binding:"required,min=6"`
|
||||
VerifyCode string `json:"verify_code" binding:"required"`
|
||||
}
|
||||
|
||||
type EmailRegisterResponse struct {
|
||||
|
||||
Reference in New Issue
Block a user