fix: allow Firebase Auth scripts in CSP"#223
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe ChangesCSP Header Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Visit the preview URL for this PR (updated for commit b8d9bb8): https://servio-0--pr223-fix-allow-firebas-au-s1rxnk1p.web.app (expires Sat, 04 Jul 2026 20:05:33 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 15915abb5951eb298a844eda460b24f444d93a69 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
firebase.json (1)
41-41: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winMirror the CSP origins in
vite.config.tsProduction now allowshttps://apis.google.com,https://www.gstatic.com, andhttps://widget.cloudinary.com, but the dev-server policy still only allows'self' 'unsafe-inline' 'unsafe-eval', so those scripts will be CSP-blocked during local development.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@firebase.json` at line 41, The dev-server CSP in vite.config.ts is missing the same script origins now allowed in production, so local development will still block them. Update the CSP policy generation in the Vite config to mirror the firebase.json script-src entries, specifically including https://apis.google.com, https://www.gstatic.com, and https://widget.cloudinary.com alongside the existing sources. Use the CSP-building logic in vite.config.ts and keep the dev and prod origins aligned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@firebase.json`:
- Line 41: The dev-server CSP in vite.config.ts is missing the same script
origins now allowed in production, so local development will still block them.
Update the CSP policy generation in the Vite config to mirror the firebase.json
script-src entries, specifically including https://apis.google.com,
https://www.gstatic.com, and https://widget.cloudinary.com alongside the
existing sources. Use the CSP-building logic in vite.config.ts and keep the dev
and prod origins aligned.
Description
The PR #222 accidently restricts external scripts .
Summary by CodeRabbit