Files
wmailhub/package.json
T
bigcode 2ce8a24707 fix(deploy): /api/* 与 /internal/* 显式 run_worker_first,修 OAuth 回调被 SPA 资源层截胡
compatibility_date >= 2025-04-01 隐式开启 assets_navigation_prefers_asset_serving:
浏览器【导航请求】不进入 Worker,直接由 SPA 资源层返回 index.html。
/api/oauth/cloudflare/callback 是浏览器跨站重定向的落点(导航请求),于是被截胡 ——
前端在无匹配路由的路径上 hydrate,渲染 React Router 的 404 页面;后端 state 完全没被消费,
表现为「Cloudflare 授权成功,回调却毫无反应」。

用 run_worker_first 路径数组(而非 true),静态资源仍走 asset-first 快路径。

- 新增 tests/deploy_config.test.ts 锁住这条部署配置(此类问题只在生产出现)
- 线上复验:导航请求打回调现在返回 Worker 的 400,不再是 200 index.html;/accounts 仍返回 SPA
2026-09-30 17:10:57 +08:00

36 lines
890 B
JSON

{
"name": "wmailhub",
"version": "2.3.4",
"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"
}
}