Commit Graph

2 Commits

Author SHA1 Message Date
angjustinl
6dece752ef test(email, verification, login): 更新测试中的断言内容, 修复测试error.
- Replace boolean assertions with structured result object checks in email service tests
- Update email service tests to verify success flag and isTestMode property
- Add error message assertions for failed email sending scenarios
- Change logger spy from 'log' to 'warn' for test mode email output
- Update test message to clarify emails are not actually sent in test mode
- Add code and createdAt properties to verification code stats mock data
- Fix TTL mock value from -1 to -2 to correctly represent non-existent keys
- Replace Inject decorator with direct UsersService type injection in LoginCoreService
- Ensure verification service tests properly mock TTL values during code verification
- Improve test coverage by validating complete response structures instead of simple booleans
2025-12-18 13:29:55 +08:00
moyin
eb7a022f5b feat:添加验证码服务
- 实现验证码生成、验证和管理功能
- 支持多种验证码类型(邮箱验证、密码重置、短信验证)
- 集成Redis缓存存储验证码
- 实现防刷机制:发送频率限制和每小时限制
- 支持验证码过期管理和尝试次数限制
- 包含完整的单元测试
2025-12-17 20:21:30 +08:00