feat(auth): 用户账户 - 完善个人资料与登录日志 (#752)

Co-authored-by: wuligao <1247662379@qq.com>
This commit is contained in:
ddcat666
2026-10-13 05:31:30 +08:00
committed by GitHub
parent e70fe1b9c9
commit 4c1d2b4012
83 changed files with 5836 additions and 328 deletions

View File

@@ -43,21 +43,23 @@ type SMSRecord struct {
// Verification tickets are immutable, short-lived and purpose/target bound.
// Only code HMACs and the hash of the high-entropy client ticket are persisted.
type AuthVerification struct {
ID string `gorm:"primaryKey;size:36"`
TokenHash string `gorm:"size:64"`
Purpose string `gorm:"size:24"`
Method string `gorm:"size:24"`
UserID string `gorm:"size:36"`
Email string `gorm:"size:160"`
Phone string `gorm:"size:24"`
EmailHash string `gorm:"size:64"`
PhoneHash string `gorm:"size:64"`
PolicyHash string `gorm:"size:64"`
Ready bool
Attempts int
ExpiresAt time.Time `gorm:"index"`
UsedAt *time.Time
CreatedAt time.Time
SessionID string `json:"-" gorm:"size:36"`
CredentialHash string `json:"-" gorm:"size:64"`
ID string `gorm:"primaryKey;size:36"`
TokenHash string `gorm:"size:64"`
Purpose string `gorm:"size:24"`
Method string `gorm:"size:24"`
UserID string `gorm:"size:36"`
Email string `gorm:"size:160"`
Phone string `gorm:"size:24"`
EmailHash string `gorm:"size:64"`
PhoneHash string `gorm:"size:64"`
PolicyHash string `gorm:"size:64"`
Ready bool
Attempts int
ExpiresAt time.Time `gorm:"index"`
UsedAt *time.Time
CreatedAt time.Time
}
// Fixed window quotas and per-recipient cooldowns are shared by all instances.