Files
wmailhub/package.json
T
bigcode 42c488050b fix(oauth): token 兑换改用 HTTP Basic(client_secret_basic),修 401
Cloudflare OAuth 客户端默认 token_endpoint_auth_method = client_secret_basic,
只接受 Authorization: Basic 头。之前把 client_id/secret 放在 POST body
(client_secret_post),token 端点直接 401 invalid_client,描述里点名
"method 'client_secret_post' was requested" —— 表现为 Cloudflare 授权成功、
回调却报 token exchange failed: 401。

- exchangeToken 改 Basic 认证,凭据按 RFC 6749 §2.3.1 先 form-urlencoded 再 base64
- 失败时带回 Cloudflare 原始 error/error_description;invalid_client 额外提示
  「secret 只在创建时显示一次,轮换后旧值失效」
- cf-mock 复刻「只认 Basic」的行为,没有 Basic 头就返回 401(旧代码会被打回)
- 断言 token body 不含 client_id/client_secret,Basic 头解出正确凭据
- 88/88 测试
2026-09-30 17:16:14 +08:00

36 lines
890 B
JSON

{
"name": "wmailhub",
"version": "2.3.5",
"description": "WmailHub - 基于 Cloudflare Email Workers 的轻量邮件接收与转发平台(Console 直连 Email Worker)",
"private": true,
"type": "module",
"scripts": {
"dev": "bun run scripts/dev.ts",
"build": "vite build",
"test": "bun test",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@ant-design/icons": "^6.3.4",
"antd": "^6.6.5",
"hono": "^4.9.0",
"node-html-parser": "^9.0.4",
"postal-mime": "^2.4.1",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"react-router-dom": "^7.9.0"
},
"devDependencies": {
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.0",
"@vitejs/plugin-react": "^6.1.1",
"bun-types": "^1.2.0",
"playwright-core": "^1.63.0",
"typescript": "^5.9.0",
"vite": "^8.3.1"
},
"engines": {
"bun": ">=1.2.0"
}
}