Fix SyntaxError in account-dashboard and expand CSP #152
Reference in New Issue
Block a user
Delete Branch "fix/syntax-error-and-csp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Two fixes in one:
1. SyntaxError in
account-dashboard.jsEl's native_js parser fails on ternary
? 'string' : 'string'— the?adjacent to single-quoted strings triggers anUnexpected stringSyntaxError in the compiled IIFE output. Entire IIFE throws at startup, meaningsignInWithis never defined onwindow, so both auth buttons do nothing withReferenceError: signInWith is not defined.Fixed by replacing the ternary with a plain if-else in the devices count block.
2. CSP blocking Stripe and Google Fonts
All three header functions (
sec_headers_json,js_headers_json,static_asset_headers_json) were missing entries that caused hard functional failures:https://js.stripe.commissing fromscript-src→ Stripe JS never loads → payment form never rendershttps://js.stripe.commissing fromframe-src→ Stripe Elements iframe blockedhttps://fonts.googleapis.commissing fromstyle-src→ Google Fonts CSS blockedhttps://fonts.gstatic.commissing fromfont-src→ Google Fonts files blockedhttps://static.cloudflareinsights.comadded toscript-src(noisy violation)Test
Verify on stage:
signInWith is not definedin console)SyntaxError: Unexpected stringin console