fix: route autopg auth through wrapper#139
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR routes the ChangesAuth routing and static asset 404 fixes
Possibly related PRs
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds the auth subcommand to the autopg-wrapper to bypass the bun probe, prevents SPA fallback for missing concrete assets with file extensions in cli-ui.cjs, and adds corresponding tests. A review comment points out that using path.extname(url) to block SPA fallback can break valid client-side routes containing dots (e.g., /users/john.doe). It suggests only blocking the fallback if the extension matches a known static asset type.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if (path.extname(url)) { | ||
| sendError(res, 404, 'NOT_FOUND', `no file at ${url}`); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Using path.extname(url) to prevent SPA fallback for any path with an extension can break client-side routing (SPA fallback) for valid routes that contain a dot in the last segment (e.g., /users/john.doe, /docs/v1.0, or /databases/my.db).
To avoid this, we should only prevent the SPA fallback if the extension matches a known static asset type defined in MIME_TYPES.
const ext = path.extname(url).toLowerCase();
if (ext && MIME_TYPES[ext]) {
sendError(res, 404, 'NOT_FOUND', `no file at ${url}`);
return;
}
Summary
autopg auththrough the v3 wrapper's pure-node dispatcher./app.jsfrom falling back toindex.htmlastext/html.Test Plan
bun test tests/console/no-cdn.test.jsbun test tests/cli-install.test.js --test-name-pattern 'autopg auth is routed'bun test tests/console/auth.test.jsAUTOPG_CONFIG_DIR=$(mktemp -d) node bin/autopg-wrapper.cjs auth show-admin-pathNotes
This targets autopg v3 (
package.jsonversion3.0.7) onmain.Summary by CodeRabbit
Release Notes
Bug Fixes
Tests