feat(auth): add comprehensive authentication system with 2FA support

- Add new auth module with captcha, login, logout, register, and email verification endpoints
- Implement two-factor authentication with TOTP enable, disable, verify, and backup codes regeneration
- Create RSA public key endpoint for secure password encryption
- Add user profile management with get current user and email retrieval
- Integrate OpenAPI documentation for all authentication endpoints
- Implement password reset functionality with email verification flow
- Add comprehensive API response structures with proper error handling
- Configure all auth routes under /api/v1/auth scope with proper tagging
This commit is contained in:
zhenyi
2026-06-07 18:09:38 +08:00
parent 2bb5834167
commit 0d3b53f7a0
24 changed files with 816 additions and 10 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ use crate::session::Session;
use super::util::clamp_limit_offset;
impl RepoService {
/// 获取页面的修订历史
/// Get the revision history for a page.
pub async fn wiki_get_revisions(
&self,
ctx: &Session,
@@ -34,7 +34,7 @@ impl RepoService {
.map_err(AppError::Database)
}
/// 获取特定版本的修订详情
/// Get details for a specific revision version.
pub async fn wiki_get_revision(
&self,
ctx: &Session,
@@ -60,7 +60,7 @@ impl RepoService {
.ok_or_else(|| AppError::NotFound("Revision not found".into()))
}
/// 比较两个版本的差异
/// Compare two revision versions.
pub async fn wiki_compare_revisions(
&self,
ctx: &Session,