Commit Graph

6 Commits

Author SHA1 Message Date
angjustinl
9b35a1c500 feat(login): Add verification code login functionality
- Add verification code login endpoint to support passwordless authentication via email or phone
- Add send login verification code endpoint to initiate verification code delivery
- Implement verificationCodeLogin method in LoginService to handle verification code authentication
- Implement sendLoginVerificationCode method in LoginService to send verification codes to users
- Add VerificationCodeLoginRequest and related DTOs to support new login flow
- Add VerificationCodeLoginDto and SendLoginVerificationCodeDto for API request validation
- Implement verificationCodeLogin and sendLoginVerificationCode in LoginCoreService
- Add comprehensive Swagger documentation for new endpoints with proper status codes and responses
- Support test mode for verification code delivery with 206 Partial Content status
- Fix UsersService dependency injection in test specifications to use string token
- Enhance authentication options by providing passwordless login alternative to traditional password-based authentication
2025-12-19 23:22:40 +08:00
angjustinl
26ea5ac815 feat(sql, auth, email, dto):重构邮箱验证流程,引入基于内存的用户服务,并改进 API 响应处理
* 新增完整的 API 状态码文档,并对测试模式进行特殊处理(`206 Partial Content`)
* 重组 DTO 结构,引入 `app.dto.ts` 与 `error_response.dto.ts`,以实现统一、规范的响应格式
* 重构登录相关 DTO,优化命名与结构,提升可维护性
* 实现基于内存的用户服务(`users_memory.service.ts`),用于开发与测试环境
* 更新邮件服务,增强验证码生成逻辑,并支持测试模式自动识别
* 增强登录控制器与服务层的错误处理能力,统一响应行为
* 优化核心登录服务,强化参数校验并集成邮箱验证流程
* 新增 `@types/express` 依赖,提升 TypeScript 类型支持与开发体验
* 改进 `main.ts`,优化应用初始化流程与配置管理
* 在所有服务中统一错误处理机制,采用标准化的错误响应格式
* 实现测试模式(`206`)与生产环境邮件发送(`200`)之间的无缝切换
2025-12-18 00:17:43 +08:00
moyin
34a9e727b4 feat:添加验证码调试功能
- 在验证码服务中添加debugCodeInfo方法
- 在业务层添加debugVerificationCode调试接口
- 新增/auth/debug-verification-code调试端点
- 支持查看验证码详细状态信息(TTL、尝试次数等)
- 便于开发和生产环境问题排查
2025-12-17 21:23:22 +08:00
moyin
5b07535002 api:更新注册接口支持邮箱验证码
- 注册接口传递邮箱验证码参数到服务层
- 更新 API 文档描述,说明验证码使用流程
- 添加发送邮箱验证码接口
- 添加验证邮箱验证码接口
- 添加重新发送邮箱验证码接口
2025-12-17 20:07:11 +08:00
moyin
d28100e103 api:为登录控制器添加完整的Swagger文档
- 添加ApiTags、ApiOperation等装饰器
- 配置详细的请求和响应文档
- 提供HTTP状态码和错误处理说明
2025-12-17 15:16:10 +08:00
moyin
e350d117d3 feat:实现用户认证系统
- 添加用户登录、注册、密码重置功能
- 支持用户名/邮箱/手机号多种登录方式
- 集成GitHub OAuth第三方登录
- 实现bcrypt密码加密存储
- 添加基于角色的权限控制
- 包含完整的数据验证和错误处理
2025-12-17 14:39:45 +08:00