Skip to content

Fix: Allow Google Sign-In in CSP and fix date validation timezone bug#235

Merged
komapc merged 1 commit intomasterfrom
fix/csp-google-signin-and-date-validation
Feb 26, 2026
Merged

Fix: Allow Google Sign-In in CSP and fix date validation timezone bug#235
komapc merged 1 commit intomasterfrom
fix/csp-google-signin-and-date-validation

Conversation

@komapc
Copy link
Owner

@komapc komapc commented Feb 26, 2026

Summary

  • CSP: Add https://accounts.google.com to script-src and connect-src in middleware/security.js — the Google Identity Services script (gsi/client) was being blocked, preventing Google Sign-In from loading
  • Test: Fix timezone bug in validateMealDate test — new Date("YYYY-MM-DD") parses date-only strings as UTC midnight, so the comparison target must use setUTCHours (not setHours) to avoid failures near midnight in non-UTC timezones

Test plan

  • Google Sign-In button loads without CSP errors in browser console
  • npm test passes (all 94 tests green)

🤖 Generated with Claude Code

Add https://accounts.google.com to script-src and connect-src in the
Content Security Policy so the Google Identity Services script can load
and make its auth requests without being blocked.

Fix timezone bug in validateMealDate test: date-only strings parsed by
new Date() are treated as UTC midnight, so the comparison target must
also use setUTCHours (not setHours) to avoid failures near midnight in
non-UTC timezones.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cursor
Copy link

cursor bot commented Feb 26, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 13.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@komapc komapc merged commit cb52c5e into master Feb 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant