iven
c2aff09811
feat(security): Auth Token HttpOnly Cookie — XSS 安全加固
后端:
- axum-extra 启用 cookie feature
- login/register/refresh 设置 HttpOnly + Secure + SameSite=Strict cookies
- 新增 POST /api/v1/auth/logout 清除 cookies
- auth_middleware 支持 cookie 提取路径(fallback from header)
- CORS: 添加 allow_credentials(true) + COOKIE header
前端 (admin-v2):
- authStore: token 仅存内存,不再写 localStorage(account 保留)
- request.ts: 添加 withCredentials: true 发送 cookies
- 修复 refresh token rotation bug(之前不更新 stored refreshToken)
- logout 调用后端清除 cookie 端点
向后兼容: API 客户端仍可用 Authorization: Bearer header
Desktop (Ed25519 设备认证) 完全不受影响
2026-03-30 19:30:42 +08:00
..
2026-03-29 23:19:41 +08:00
2026-03-30 10:55:08 +08:00
2026-03-30 13:32:22 +08:00
2026-03-29 10:46:41 +08:00
2026-03-30 18:23:13 +08:00
2026-03-29 10:46:41 +08:00
2026-03-30 09:24:50 +08:00
2026-03-30 19:30:42 +08:00
2026-03-30 10:55:08 +08:00
2026-03-30 10:55:08 +08:00