Commit Graph

5 Commits (3913640f5b12f749011cf06ac7dc2e1d2346a19c)

Author SHA1 Message Date
veypi 3913640f5b feat(auth): replace user-level token version with session-based authentication
- Replace global user token version with per-session versioning in JWT claims
    - Add session CRUD operations with DB + Redis dual-write caching strategy
    - Create/list/revoke individual sessions and batch revoke other sessions
    - Update login flow to create sessions with device info and IP extraction
    - Update refresh flow to validate and rotate session-level token version
    - Update logout to revoke only the current session instead of all tokens
    - Add session management UI page with device/browser detection and relative time display
    - Add i18n keys for session management in both Chinese and English
    - Add sessions route and navigation menu items in both default and icon layouts
4 days ago
veypi c8504c3f70 feat(api/auth): Add batch query user API
- Add POST /api/auth/users endpoint for batch user query
    - Add IDs filter to SearchUsersRequest for batch lookup
    - Add Name and Icon fields to PublicUserInfo response
    - Implement searchUsersByIDs with deduplication and ordering
    - Extract buildPublicUserInfo helper for consistent public info mapping
2 months ago
veypi b0322047cd feat: Restrict user APIs to admins and add public user search
- Add /api/auth/users endpoint for authenticated users to search other users
    - Only return public info (id, username, nickname, avatar) in search results
    - Change /api/user routes to require user:admin permission instead of user:read
    - Update auth tests to use /api/auth/me for self updates
    - Add tests for new user search endpoint
4 months ago
veypi 23c7f6cb7a refactor(auth): 重构认证系统,支持多种验证方式和 OAuth 提供商管理
- 新增验证模块(api/verification),统一处理短信和邮件验证码发送
    - 新增邮件发送功能(libs/email),支持 SMTP 协议
    - 重构短信模块(libs/sms),简化阿里云和腾讯云短信接口
    - 新增 OAuth 提供商管理 API(api/oauth/providers),支持 CRUD 操作
    - 新增系统设置管理 API(api/settings),支持动态配置更新
    - 重构认证方式管理(api/auth/methods),支持启用/禁用多种登录方式
    - 删除旧的 sms_providers 和 sms API 模块,迁移至新验证体系
    - 新增数据库模型:verification、email、oauth_provider、oauth_templates、setting
    - 更新配置文档,增加新功能的使用说明
4 months ago
veypi 52f2ae35ab upgrade new version 4 months ago