程序员阿江(Relakkes)
|
142eb9cd11
|
feat(desktop): add /api/haha-oauth REST endpoints
Endpoints:
- POST /api/haha-oauth/start — 生成 PKCE,返回 authorize URL
- GET /api/haha-oauth/callback — 浏览器 redirect 到此,完成 token exchange,
渲染 success/fail HTML 页(自动关闭)
- GET /api/haha-oauth — 查询登录状态(不回传 token 本体)
- DELETE /api/haha-oauth — 登出,清除 token 文件
前端用 start 拿到 authorizeUrl → shell.open(浏览器) → 浏览器走 OAuth → redirect
到 callback → callback 完成后显示 '登录成功,可关闭窗口' 页面。前端并行轮询
/api/haha-oauth 检测 loggedIn=true 后刷新 UI。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
2026-04-17 19:59:42 +08:00 |
|